diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-17 11:15:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-17 11:15:15 +0000 |
commit | 152da8847e828b132c5753ae5f58e8272556d4ef (patch) | |
tree | 7c96822b3ea2dee6257071d557259177c11da6f0 /plugins/CryptoPP/src | |
parent | 79c0e81fbfd1f933a1e251db23dc1fd537ddd239 (diff) |
some another leaks fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4070 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src')
-rw-r--r-- | plugins/CryptoPP/src/main.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index af7aa6306f..7869c8d416 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -31,14 +31,21 @@ PLUGININFOEX pluginInfoEx = { BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID)
{
- g_hInst = hInst;
- InitializeCriticalSection(&localQueueMutex);
- InitializeCriticalSection(&localContextMutex);
-#ifdef _DEBUG
- isVista = 1;
-#else
- isVista = ( (DWORD)(LOBYTE(LOWORD(GetVersion()))) == 6 );
-#endif
+ if (dwReason == DLL_PROCESS_ATTACH) {
+ g_hInst = hInst;
+ #ifdef _DEBUG
+ isVista = 1;
+ #else
+ isVista = ( (DWORD)(LOBYTE(LOWORD(GetVersion()))) == 6 );
+ #endif
+ InitializeCriticalSection(&localQueueMutex);
+ InitializeCriticalSection(&localContextMutex);
+ }
+ else if (dwReason == DLL_PROCESS_DETACH) {
+ DeleteCriticalSection(&localQueueMutex);
+ DeleteCriticalSection(&localContextMutex);
+ }
+
return TRUE;
}
|