summaryrefslogtreecommitdiff
path: root/src/mir_core/miranda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_core/miranda.cpp')
-rw-r--r--src/mir_core/miranda.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index 9a3719f845..57c126bdbe 100644
--- a/src/mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
@@ -97,5 +97,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
mir_tls = TlsAlloc();
LoadCoreModule();
}
+ else if (fdwReason == DLL_THREAD_DETACH) {
+ HANDLE hEvent = TlsGetValue(mir_tls);
+ if (hEvent)
+ CloseHandle(hEvent);
+ }
return TRUE;
}