Skip to content
Commit 48997c88 authored by Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto 💬
Browse files

object: Avoid modifying weak_pointer_list while iterating it

Inside update_heap_wrapper_weak_pointers(), we disassociate the
object while iterating over weak_pointer_list. It is possible,
however, that that disassociating the object causes the weak
pointer to be disposed, which will then call wrapped_gobj_dispose_notify(),
which will modify weak_pointer_list again, while the update_heap...
function is still iterating.

This will left weak_pointer_list with a dangling pointer and
will cause a crash.

Fix that by storing the to-be-disassociated objects in a temporary
list, wait for the iteration over weak_pointer_list finish, and
then disassociate it.

https://bugzilla.gnome.org/show_bug.cgi?id=781194
parent 1e0bbae1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment