gobject: Cleanup weak locations data as part of dispose

Weak locations were not fully cleaned on run_dispose() and after dispose
vfunc was called, so ensure that this is the case.

Fixes: #865
This commit is contained in:
Marco Trevisan (Treviño)
2021-09-15 22:02:09 +02:00
parent e861f60dcb
commit a7262d6357
2 changed files with 28 additions and 1 deletions

View File

@@ -1179,6 +1179,7 @@ g_object_real_dispose (GObject *object)
g_signal_handlers_destroy (object);
g_datalist_id_set_data (&object->qdata, quark_closure_array, NULL);
g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL);
g_datalist_id_set_data (&object->qdata, quark_weak_locations, NULL);
}
static void
@@ -3574,7 +3575,8 @@ g_object_unref (gpointer _object)
g_datalist_id_set_data (&object->qdata, quark_closure_array, NULL);
g_signal_handlers_destroy (object);
g_datalist_id_set_data (&object->qdata, quark_weak_refs, NULL);
g_datalist_id_set_data (&object->qdata, quark_weak_locations, NULL);
/* decrement the last reference */
old_ref = g_atomic_int_add (&object->ref_count, -1);
g_return_if_fail (old_ref > 0);