mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 12:53:07 +02:00
Merge branch 'object-refcount-checks' into 'main'
gobject: Check for valid ref counting via g_return_if_fail See merge request GNOME/glib!3106
This commit is contained in:
commit
720a1147a6
@ -1468,9 +1468,7 @@ void
|
|||||||
g_object_freeze_notify (GObject *object)
|
g_object_freeze_notify (GObject *object)
|
||||||
{
|
{
|
||||||
g_return_if_fail (G_IS_OBJECT (object));
|
g_return_if_fail (G_IS_OBJECT (object));
|
||||||
|
g_return_if_fail (g_atomic_int_get (&object->ref_count) > 0);
|
||||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_object_ref (object);
|
g_object_ref (object);
|
||||||
g_object_notify_queue_freeze (object, FALSE);
|
g_object_notify_queue_freeze (object, FALSE);
|
||||||
@ -1670,9 +1668,8 @@ g_object_thaw_notify (GObject *object)
|
|||||||
GObjectNotifyQueue *nqueue;
|
GObjectNotifyQueue *nqueue;
|
||||||
|
|
||||||
g_return_if_fail (G_IS_OBJECT (object));
|
g_return_if_fail (G_IS_OBJECT (object));
|
||||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
g_return_if_fail (g_atomic_int_get (&object->ref_count) > 0);
|
||||||
return;
|
|
||||||
|
|
||||||
g_object_ref (object);
|
g_object_ref (object);
|
||||||
|
|
||||||
/* FIXME: Freezing is the only way to get at the notify queue.
|
/* FIXME: Freezing is the only way to get at the notify queue.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user