g_object_unref assert in debug code
Submitted by Morten Welinder
Link to original bug (#563872)
Description
It would be useful if the assert in g_object_unref was changed to something like...
gboolean ok;
/* catch objects not chaining finalize handlers */
G_LOCK (debug_objects);
ok = (g_hash_table_lookup (debug_objects_ht, object) == NULL);
G_UNLOCK (debug_objects);
if (!ok) {
g_warning ("Object %p of type %s not finalized correctly.",
object, G_OBJECT_TYPE_NAME (object));
g_hash_table_remove (debug_objects_ht, object);
}
i.e., something non-critical. The program can go on just fine and tell me about other problems. (And people should run this occasionally, see bug 563803.)