Skip to content

Handle the case of g_object_run_dispose() in GBinding

Sebastian Dröge requested to merge sdroege/glib:weak-notify-dispose into master

When this is called on the source or target, the weak notify of the corresponding object is called without the GWeakRef being cleared. See #2266 (closed) for that issue.

This means that a strong reference to these zombie objects can be retrieved from the GWeakRefs and the previous assumption that this can't happen was wrong. Remove the assertion for that accordingly and handle this case.

Specifically, all signal handlers and weak notifies of the object are already gone and must not be disconnected/removed a second time, or otherwise memory corruption would be caused. Instead just set the GWeakRef to NULL and handle it otherwise as if the GWeakRef didn't give a strong reference to begin with.

Fixes #2265 (closed)

Merge request reports