mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Fix deadlock in g_object_remove_toggle_ref()
The code section guarded with toggle_refs_mutex includes a call to g_object_unref(), which may call toggle_refs_notify(). As the latter tries to acquire the same mutex, glib locks up. https://bugzilla.gnome.org/show_bug.cgi?id=632884
This commit is contained in:
parent
b7616114c6
commit
a62b43fd9c
@ -2587,14 +2587,14 @@ g_object_remove_toggle_ref (GObject *object,
|
|||||||
if (tstack->n_toggle_refs == 0)
|
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_object_unref (object);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
G_UNLOCK (toggle_refs_mutex);
|
G_UNLOCK (toggle_refs_mutex);
|
||||||
|
|
||||||
if (!found_one)
|
if (found_one)
|
||||||
|
g_object_unref (object);
|
||||||
|
else
|
||||||
g_warning ("%s: couldn't find toggle ref %p(%p)", G_STRFUNC, notify, data);
|
g_warning ("%s: couldn't find toggle ref %p(%p)", G_STRFUNC, notify, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user