gobject: Don't thaw excessively

We need to match the conditions in g_object_init
for when we already have a freeze. Without that,
we underflow the freeze count and trigger a
warning.

Fixes: #2666
This commit is contained in:
Matthias Clasen 2022-06-08 13:29:38 -04:00 committed by Philip Withnall
parent 12152788f9
commit 98bd4eabf2

View File

@ -2128,7 +2128,7 @@ g_object_new_with_custom_constructor (GObjectClass *class,
/* Remember: if it was newly_constructed then g_object_init()
* already did a freeze, so we now have two. Release one.
*/
if (newly_constructed)
if (newly_constructed && CLASS_HAS_NOTIFY (class))
g_object_notify_queue_thaw (object, nqueue);
}