Merge branch 'wip/smcv/revert-fa8c7c0d' into 'main'

Revert "gobject: Use g_datalist_id_remove_multiple"

See merge request GNOME/glib!2784
This commit is contained in:
Michael Catanzaro 2022-06-26 17:16:51 +00:00
commit 6e81c21a8b

View File

@ -1353,17 +1353,10 @@ g_object_do_get_property (GObject *object,
static void static void
g_object_real_dispose (GObject *object) g_object_real_dispose (GObject *object)
{ {
GQuark keys[3] = {
quark_closure_array,
quark_weak_refs,
quark_weak_locations,
};
g_signal_handlers_destroy (object); g_signal_handlers_destroy (object);
/* FIXME: This should be simplified down to a single remove_multiple() call. g_datalist_id_set_data (&object->qdata, quark_closure_array, NULL);
* See https://gitlab.gnome.org/GNOME/glib/-/issues/2672 */ g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL);
g_datalist_id_remove_multiple (&object->qdata, keys, 1); g_datalist_id_set_data (&object->qdata, quark_weak_locations, NULL);
g_datalist_id_remove_multiple (&object->qdata, keys + 1, 2);
} }
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
@ -3888,15 +3881,10 @@ g_object_unref (gpointer _object)
} }
/* we are still in the process of taking away the last ref */ /* we are still in the process of taking away the last ref */
g_datalist_id_set_data (&object->qdata, quark_closure_array, NULL);
g_signal_handlers_destroy (object); g_signal_handlers_destroy (object);
{ g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL);
GQuark keys[3] = { g_datalist_id_set_data (&object->qdata, quark_weak_locations, NULL);
quark_closure_array,
quark_weak_refs,
quark_weak_locations,
};
g_datalist_id_remove_multiple (&object->qdata, keys, G_N_ELEMENTS (keys));
}
/* decrement the last reference */ /* decrement the last reference */
old_ref = g_atomic_int_add (&object->ref_count, -1); old_ref = g_atomic_int_add (&object->ref_count, -1);