mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
gsignal: Do not try to lookup the signal id and work on unlocked node
In g_signal_parse_name we were looking up for the signal from the name keeping the mutex locked, but we then retrieved and checked the node data without keeping the lock, so with another thread potentially changing that.
This commit is contained in:
parent
ae14f3219a
commit
42d52033db
@ -1216,12 +1216,17 @@ g_signal_parse_name (const gchar *detailed_signal,
|
||||
|
||||
SIGNAL_LOCK ();
|
||||
signal_id = signal_parse_name (detailed_signal, itype, &detail, force_detail_quark);
|
||||
SIGNAL_UNLOCK ();
|
||||
|
||||
node = signal_id ? LOOKUP_SIGNAL_NODE (signal_id) : NULL;
|
||||
|
||||
if (!node || node->destroyed ||
|
||||
(detail && !(node->flags & G_SIGNAL_DETAILED)))
|
||||
return FALSE;
|
||||
{
|
||||
SIGNAL_UNLOCK ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SIGNAL_UNLOCK ();
|
||||
|
||||
if (signal_id_p)
|
||||
*signal_id_p = signal_id;
|
||||
|
Loading…
Reference in New Issue
Block a user