mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gobject: remove data when last toggle ref is removed
Toggle refs are seldom used, and when they are, it makes mostly sense that there is only one of them. Thus, when removing the last toggle ref, also remove the associated data.
This commit is contained in:
@@ -3723,7 +3723,10 @@ g_object_remove_toggle_ref (GObject *object,
|
||||
tstack->toggle_refs[i] = tstack->toggle_refs[tstack->n_toggle_refs];
|
||||
|
||||
if (tstack->n_toggle_refs == 0)
|
||||
g_datalist_unset_flags (&object->qdata, OBJECT_HAS_TOGGLE_REF_FLAG);
|
||||
{
|
||||
g_datalist_unset_flags (&object->qdata, OBJECT_HAS_TOGGLE_REF_FLAG);
|
||||
g_datalist_id_set_data_full (&object->qdata, quark_toggle_refs, NULL, NULL);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user