mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
Merge branch 'wip/chergert/merge-private-fix' into 'glib-2-66'
gthread: Destroy value after replacing it in g_private_replace() See merge request GNOME/glib!1820
This commit is contained in:
commit
4c6daefd6b
@ -1116,11 +1116,12 @@ g_private_replace (GPrivate *key,
|
||||
gint status;
|
||||
|
||||
old = pthread_getspecific (*impl);
|
||||
if (old && key->notify)
|
||||
key->notify (old);
|
||||
|
||||
if G_UNLIKELY ((status = pthread_setspecific (*impl, value)) != 0)
|
||||
g_thread_abort (status, "pthread_setspecific");
|
||||
|
||||
if (old && key->notify)
|
||||
key->notify (old);
|
||||
}
|
||||
|
||||
/* {{{1 GThread */
|
||||
|
@ -373,9 +373,9 @@ g_private_replace (GPrivate *key,
|
||||
gpointer old;
|
||||
|
||||
old = TlsGetValue (impl);
|
||||
TlsSetValue (impl, value);
|
||||
if (old && key->notify)
|
||||
key->notify (old);
|
||||
TlsSetValue (impl, value);
|
||||
}
|
||||
|
||||
/* {{{1 GThread */
|
||||
|
Loading…
Reference in New Issue
Block a user