gobject: Trace unref just after this happened

Trace the unref before potentially calling (user) code that may re-ref
or unref again, causing the tracing order to be messed up.
This commit is contained in:
Marco Trevisan (Treviño) 2022-12-06 04:43:02 +01:00
parent 0918ce013a
commit 6cd6cc41bb

View File

@ -3885,11 +3885,11 @@ g_object_unref (gpointer _object)
&old_ref))
continue;
TRACE (GOBJECT_OBJECT_UNREF (object, G_TYPE_FROM_INSTANCE (object), old_ref));
/* emit all notifications that have been queued during dispose() */
g_object_notify_queue_thaw (object, nqueue);
TRACE (GOBJECT_OBJECT_UNREF(object,G_TYPE_FROM_INSTANCE(object),old_ref));
/* if we went from 2->1 we need to notify toggle refs if any */
if (old_ref == 2 && OBJECT_HAS_TOGGLE_REF (object) &&
g_atomic_int_get ((int *)&object->ref_count) == 1)