gobject: Speed up finalization

Move the warning about finalize-during-construction
to debug-only.
This commit is contained in:
Matthias Clasen 2022-05-22 08:04:51 -04:00
parent fa8c7c0da6
commit b7be0f95a8

View File

@ -1214,13 +1214,13 @@ floating_check (GObject *object)
static void static void
g_object_finalize (GObject *object) g_object_finalize (GObject *object)
{ {
#ifdef G_ENABLE_DEBUG
if (object_in_construction (object)) if (object_in_construction (object))
{ {
g_critical ("object %s %p finalized while still in-construction", g_critical ("object %s %p finalized while still in-construction",
G_OBJECT_TYPE_NAME (object), object); G_OBJECT_TYPE_NAME (object), object);
} }
#ifdef G_ENABLE_DEBUG
if (floating_check (object)) if (floating_check (object))
{ {
g_critical ("A floating object %s %p was finalized. This means that someone\n" g_critical ("A floating object %s %p was finalized. This means that someone\n"