From 64423c96fd2d227a52b447a254b1fcfbb6cb5ec0 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 10 May 2021 10:25:27 -0400 Subject: [PATCH] gobject: Don't crash if debug hash doesn't match expectations At the moment if a GObject fails to chain up to finalize the object won't get removed from the hash at finalize time. This commit drops the assertions. --- gobject/gobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gobject/gobject.c b/gobject/gobject.c index 81a1162e9..d67987437 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1064,7 +1064,6 @@ g_object_finalize (GObject *object) GOBJECT_IF_DEBUG (OBJECTS, { G_LOCK (debug_objects); - g_assert (g_hash_table_contains (debug_objects_ht, object)); g_hash_table_remove (debug_objects_ht, object); debug_objects_count--; G_UNLOCK (debug_objects); @@ -3345,7 +3344,7 @@ g_object_unref (gpointer _object) { /* catch objects not chaining finalize handlers */ G_LOCK (debug_objects); - g_assert (!g_hash_table_contains (debug_objects_ht, object)); + g_hash_table_remove (debug_objects_ht, object); G_UNLOCK (debug_objects); }); g_type_free_instance ((GTypeInstance*) object);