mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
gobject: Clarify assertion failure on ref-after-finalize
Rename the variables involved so that people get a slightly more obvious critical warning when they try to ref an object which has already been finalised. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
eb0f73a39c
commit
641bbd0848
@ -3361,11 +3361,13 @@ gpointer
|
||||
{
|
||||
GObject *object = _object;
|
||||
gint old_val;
|
||||
gboolean object_already_finalized;
|
||||
|
||||
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
|
||||
|
||||
old_val = g_atomic_int_add (&object->ref_count, 1);
|
||||
g_return_val_if_fail (old_val > 0, NULL);
|
||||
object_already_finalized = (old_val <= 0);
|
||||
g_return_val_if_fail (!object_already_finalized, NULL);
|
||||
|
||||
if (old_val == 1 && OBJECT_HAS_TOGGLE_REF (object))
|
||||
toggle_refs_notify (object, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user