winhttp: Release typeinfos and typelib on dll unload.

This commit is contained in:
Nikolay Sivov 2015-01-14 13:48:48 +03:00 committed by Alexandre Julliard
parent 3816e44da1
commit e606551c21
3 changed files with 14 additions and 0 deletions

View file

@ -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;

View file

@ -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,

View file

@ -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 )
{