From e606551c21f59bac21ed1d33901c3a1740e5a6a3 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 14 Jan 2015 13:48:48 +0300 Subject: [PATCH] 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 9cdcc989024..cd2d114a24b 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 a5f5897338d..de5eae42ce7 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 d08d153145e..51043fdee34 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 ) {