Francois Gouget : pdh: Delete the static critical section when unloading the dll.

Alexandre Julliard julliard at winehq.org
Thu Nov 17 12:52:34 CST 2011


Module: wine
Branch: master
Commit: fcd8a8f447f9774faeb2e1b31cea3d09d8507025
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fcd8a8f447f9774faeb2e1b31cea3d09d8507025

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Nov 17 09:53:39 2011 +0100

pdh: Delete the static critical section when unloading the dll.

---

 dlls/pdh/pdh_main.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index bdf83a9..69f0d71 100644
--- a/dlls/pdh/pdh_main.c
+++ b/dlls/pdh/pdh_main.c
@@ -85,12 +85,16 @@ static inline WCHAR *pdh_strdup_aw( const char *src )
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
-
-    if (fdwReason == DLL_WINE_PREATTACH) return FALSE;    /* prefer native version */
-
-    if (fdwReason == DLL_PROCESS_ATTACH)
+    switch (fdwReason)
     {
-        DisableThreadLibraryCalls( hinstDLL );
+    case DLL_WINE_PREATTACH:
+        return FALSE;    /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(hinstDLL);
+        break;
+    case DLL_PROCESS_DETACH:
+        DeleteCriticalSection(&pdh_handle_cs);
+        break;
     }
 
     return TRUE;




More information about the wine-cvs mailing list