mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 10:38:08 +01:00
Merge branch 'ebassi/notify-queue-finalize-warning' into 'main'
Improve notification queue warning See merge request GNOME/glib!3119
This commit is contained in:
commit
7bb0261407
@ -1468,7 +1468,17 @@ void
|
||||
g_object_freeze_notify (GObject *object)
|
||||
{
|
||||
g_return_if_fail (G_IS_OBJECT (object));
|
||||
g_return_if_fail (g_atomic_int_get (&object->ref_count) > 0);
|
||||
|
||||
#ifndef G_DISABLE_CHECKS
|
||||
if (G_UNLIKELY (g_atomic_int_get (&object->ref_count) == 0))
|
||||
{
|
||||
g_critical ("Attempting to freeze the notification queue for object %s[%p]; "
|
||||
"Property notification does not work during instance finalization.",
|
||||
G_OBJECT_TYPE_NAME (object),
|
||||
object);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_object_ref (object);
|
||||
g_object_notify_queue_freeze (object, FALSE);
|
||||
@ -1668,7 +1678,18 @@ g_object_thaw_notify (GObject *object)
|
||||
GObjectNotifyQueue *nqueue;
|
||||
|
||||
g_return_if_fail (G_IS_OBJECT (object));
|
||||
g_return_if_fail (g_atomic_int_get (&object->ref_count) > 0);
|
||||
|
||||
#ifndef G_DISABLE_CHECKS
|
||||
if (G_UNLIKELY (g_atomic_int_get (&object->ref_count) == 0))
|
||||
{
|
||||
g_critical ("Attempting to thaw the notification queue for object %s[%p]; "
|
||||
"Property notification does not work during instance finalization.",
|
||||
G_OBJECT_TYPE_NAME (object),
|
||||
object);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
g_object_ref (object);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user