Commit e606551c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

winhttp: Release typeinfos and typelib on dll unload.

parent 3816e44d
...@@ -48,6 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) ...@@ -48,6 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
if (lpv) break; if (lpv) break;
netconn_unload(); netconn_unload();
release_typelib();
break; break;
} }
return TRUE; return TRUE;
......
...@@ -2758,6 +2758,18 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret ) ...@@ -2758,6 +2758,18 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
return S_OK; 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( static HRESULT WINAPI winhttp_request_GetTypeInfo(
IWinHttpRequest *iface, IWinHttpRequest *iface,
UINT index, UINT index,
......
...@@ -283,6 +283,7 @@ BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HID ...@@ -283,6 +283,7 @@ BOOL set_server_for_hostname( connect_t *, LPCWSTR, INTERNET_PORT ) DECLSPEC_HID
void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN; void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN; extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN;
void release_typelib( void ) DECLSPEC_HIDDEN;
static inline void *heap_alloc( SIZE_T size ) static inline void *heap_alloc( SIZE_T size )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment