mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-18 19:51:57 +02:00
gobject: Small speedup in weak-ref-set
This commit is contained in:
parent
043f3dcf11
commit
3290ebfadc
@ -5053,14 +5053,16 @@ g_weak_ref_set (GWeakRef *weak_ref,
|
|||||||
/* Remove the weak ref from the old object */
|
/* Remove the weak ref from the old object */
|
||||||
if (old_object != NULL)
|
if (old_object != NULL)
|
||||||
{
|
{
|
||||||
gboolean in_weak_refs_notify;
|
|
||||||
|
|
||||||
weak_locations = g_datalist_id_get_data (&old_object->qdata, quark_weak_locations);
|
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;
|
if (weak_locations == NULL)
|
||||||
/* for it to point to an object, the object must have had it added once */
|
{
|
||||||
g_assert (weak_locations != NULL || in_weak_refs_notify);
|
#ifndef G_DISABLE_ASSERT
|
||||||
|
gboolean in_weak_refs_notify =
|
||||||
if (weak_locations != NULL)
|
g_datalist_id_get_data (&old_object->qdata, quark_weak_refs) == NULL;
|
||||||
|
g_assert (in_weak_refs_notify);
|
||||||
|
#endif /* G_DISABLE_ASSERT */
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
*weak_locations = g_slist_remove (*weak_locations, weak_ref);
|
*weak_locations = g_slist_remove (*weak_locations, weak_ref);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user