mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01: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:
parent
4da4220c8b
commit
2276099236
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user