win32: stop leaking GPrivate data

Instead of running the GPrivate destructors from our thread proxy code,
run it from the DllMain handler for the DLL_THREAD_DETACH case.

This should ensure that thread-local data is free at the exit of all
threads -- not just the ones we created for ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=660745
This commit is contained in:
Ryan Lortie
2011-10-04 16:08:27 -04:00
parent dd09a95543
commit f1512917e6
3 changed files with 54 additions and 46 deletions

View File

@@ -31,6 +31,7 @@ GLIB_VAR gboolean g_mem_gc_friendly;
#ifdef G_OS_WIN32
#include <windows.h>
G_GNUC_INTERNAL void g_thread_win32_thread_detach (void);
G_GNUC_INTERNAL void g_thread_win32_init (void);
G_GNUC_INTERNAL extern HMODULE glib_dll;
#endif