mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
Merge branch '2210-private-replace-destroy' into 'master'
gthread: Destroy value after replacing it in g_private_replace() Closes #2210 See merge request GNOME/glib!1667
This commit is contained in:
commit
06dabe05b1
@ -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