Nikolay Sivov : winhttp: Release typeinfos and typelib on dll unload.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 14 14:35:42 CST 2015


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jan 14 13:48:48 2015 +0300

winhttp: Release typeinfos and typelib on dll unload.

---

 dlls/winhttp/main.c            |  1 +
 dlls/winhttp/request.c         | 12 ++++++++++++
 dlls/winhttp/winhttp_private.h |  1 +
 3 files changed, 14 insertions(+)

diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c
index 9cdcc98..cd2d114 100644
--- a/dlls/winhttp/main.c
+++ b/dlls/winhttp/main.c
@@ -48,6 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
     case DLL_PROCESS_DETACH:
         if (lpv) break;
         netconn_unload();
+        release_typelib();
         break;
     }
     return TRUE;
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index a5f5897..de5eae4 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2758,6 +2758,18 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
     return S_OK;
 }
 
+void release_typelib(void)
+{
+    unsigned i;
+
+    for (i = 0; i < sizeof(winhttp_typeinfo)/sizeof(*winhttp_typeinfo); i++)
+        if (winhttp_typeinfo[i])
+            ITypeInfo_Release(winhttp_typeinfo[i]);
+
+    if (winhttp_typelib)
+        ITypeLib_Release(winhttp_typelib);
+}
+
 static HRESULT WINAPI winhttp_request_GetTypeInfo(
     IWinHttpRequest *iface,
     UINT index,
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index d08d153..51043fd 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -283,6 +283,7 @@ BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HID
 void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
 
 extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN;
+void release_typelib( void ) DECLSPEC_HIDDEN;
 
 static inline void *heap_alloc( SIZE_T size )
 {




More information about the wine-cvs mailing list