mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 09:46:17 +01:00
Make the implementation of GPrivate behave more closely as in POSIX
2006-02-20 Tor Lillqvist <tml@novell.com> * gthread-win32.c (g_thread_exit_win32_impl): Make the implementation of GPrivate behave more closely as in POSIX threads: The value associacted with a GPrivate must be set to NULL before calling the destructor. (The destructor gets the original value as argument.) A destructor might re-associate a non-NULL value with some GPrivate. To deal with this, if after all destructors have been called, there still are some non-NULL values, the process is repeated. (#331367)
This commit is contained in:
parent
dde67f284d
commit
b4168ad3b2
@ -1,3 +1,14 @@
|
|||||||
|
2006-02-20 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
|
* gthread-win32.c (g_thread_exit_win32_impl): Make the
|
||||||
|
implementation of GPrivate behave more closely as in POSIX
|
||||||
|
threads: The value associacted with a GPrivate must be set to NULL
|
||||||
|
before calling the destructor. (The destructor gets the original
|
||||||
|
value as argument.) A destructor might re-associate a non-NULL
|
||||||
|
value with some GPrivate. To deal with this, if after all
|
||||||
|
destructors have been called, there still are some non-NULL
|
||||||
|
values, the process is repeated. (#331367)
|
||||||
|
|
||||||
2006-02-10 Matthias Clasen <mclasen@redhat.com>
|
2006-02-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* === Released 2.9.6 ===
|
* === Released 2.9.6 ===
|
||||||
|
@ -414,13 +414,24 @@ g_thread_exit_win32_impl (void)
|
|||||||
|
|
||||||
if (array)
|
if (array)
|
||||||
{
|
{
|
||||||
for (i = 0; i < private_max; i++)
|
gboolean some_data_non_null;
|
||||||
{
|
|
||||||
GDestroyNotify destructor = g_private_destructors[i];
|
do {
|
||||||
GDestroyNotify data = array[i];
|
some_data_non_null = FALSE;
|
||||||
if (destructor && data)
|
for (i = 0; i < private_max; i++)
|
||||||
destructor (data);
|
{
|
||||||
}
|
GDestroyNotify destructor = g_private_destructors[i];
|
||||||
|
GDestroyNotify data = array[i];
|
||||||
|
|
||||||
|
if (data)
|
||||||
|
some_data_non_null = TRUE;
|
||||||
|
|
||||||
|
array[i] = NULL;
|
||||||
|
|
||||||
|
if (destructor && data)
|
||||||
|
destructor (data);
|
||||||
|
}
|
||||||
|
} while (some_data_non_null);
|
||||||
|
|
||||||
g_free (array);
|
g_free (array);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user