mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-26 11:57:51 +02:00
Merge branch '2672-dataset-tests-and-fixes' into 'main'
gdataset: Preserve destruction order Closes #2672 and #2676 See merge request GNOME/glib!2776
This commit is contained in:
@@ -5049,16 +5049,22 @@ g_weak_ref_set (GWeakRef *weak_ref,
|
||||
/* Remove the weak ref from the old object */
|
||||
if (old_object != NULL)
|
||||
{
|
||||
gboolean in_weak_refs_notify;
|
||||
|
||||
weak_locations = g_datalist_id_get_data (&old_object->qdata, quark_weak_locations);
|
||||
in_weak_refs_notify = g_datalist_id_get_data (&old_object->qdata, quark_weak_refs) == NULL;
|
||||
/* for it to point to an object, the object must have had it added once */
|
||||
g_assert (weak_locations != NULL);
|
||||
g_assert (weak_locations != NULL || in_weak_refs_notify);
|
||||
|
||||
*weak_locations = g_slist_remove (*weak_locations, weak_ref);
|
||||
|
||||
if (!*weak_locations)
|
||||
if (weak_locations != NULL)
|
||||
{
|
||||
weak_locations_free_unlocked (weak_locations);
|
||||
g_datalist_id_remove_no_notify (&old_object->qdata, quark_weak_locations);
|
||||
*weak_locations = g_slist_remove (*weak_locations, weak_ref);
|
||||
|
||||
if (!*weak_locations)
|
||||
{
|
||||
weak_locations_free_unlocked (weak_locations);
|
||||
g_datalist_id_remove_no_notify (&old_object->qdata, quark_weak_locations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user