aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/threads.c')
-rw-r--r--Alc/threads.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/threads.c b/Alc/threads.c
index ca004903..cf9e5bed 100644
--- a/Alc/threads.c
+++ b/Alc/threads.c
@@ -205,12 +205,17 @@ int almtx_timedlock(almtx_t *mtx, const struct timespec *ts)
* function pointer in a ".CRT$XLx" section (where x is a character A to Z)
* ensures the CRT will call it similar to DllMain.
*/
-UIntMap TlsDestructors;
+static UIntMap TlsDestructors = UINTMAP_STATIC_INITIALIZE;
static void NTAPI altss_callback(void* UNUSED(handle), DWORD reason, void* UNUSED(reserved))
{
ALsizei i;
+ if(reason == DLL_PROCESS_DETACH)
+ {
+ ResetUIntMap(&TlsDestructors);
+ return;
+ }
if(reason != DLL_THREAD_DETACH)
return;