From 152da8847e828b132c5753ae5f58e8272556d4ef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Mar 2013 11:15:15 +0000 Subject: some another leaks fixed git-svn-id: http://svn.miranda-ng.org/main/trunk@4070 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/src/main.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'plugins/CryptoPP') 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; } -- cgit v1.2.3