diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-23 19:16:57 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-23 19:16:57 +0000 |
commit | dcb6bcdd69443e229f1ead5ee4a6c2a4622890f5 (patch) | |
tree | 295ec22cdd4e216087c29d6fbab6ba8921f007b0 /src/mir_core/miranda.cpp | |
parent | 5c794a21c8e0c943e69b08a9ba52064149d663a6 (diff) |
more correct variant of tls
git-svn-id: http://svn.miranda-ng.org/main/trunk@1135 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core/miranda.cpp')
-rw-r--r-- | src/mir_core/miranda.cpp | 5 |
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;
}
|