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
Please register or sign in to comment