Merge branch '179-object-unref-warning' into 'master'

gobject: Convert a debug check from an assertion to a g_critical()

Closes #179

See merge request GNOME/glib!389
This commit is contained in:
Philip Withnall 2018-10-10 23:36:20 +00:00
commit 6c8b9f31b1

View File

@ -3349,10 +3349,16 @@ g_object_unref (gpointer _object)
GOBJECT_IF_DEBUG (OBJECTS, GOBJECT_IF_DEBUG (OBJECTS,
{ {
gboolean was_present;
/* catch objects not chaining finalize handlers */ /* catch objects not chaining finalize handlers */
G_LOCK (debug_objects); G_LOCK (debug_objects);
g_assert (!g_hash_table_contains (debug_objects_ht, object)); was_present = g_hash_table_remove (debug_objects_ht, object);
G_UNLOCK (debug_objects); G_UNLOCK (debug_objects);
if (was_present)
g_critical ("Object %p of type %s not finalized correctly.",
object, G_OBJECT_TYPE_NAME (object));
}); });
g_type_free_instance ((GTypeInstance*) object); g_type_free_instance ((GTypeInstance*) object);
} }