Commit 4782be7e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

hnetcfg: Release typeinfos and typelib on dll unload.

parent aef50786
...@@ -148,6 +148,18 @@ HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret ) ...@@ -148,6 +148,18 @@ 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(typeinfo)/sizeof(*typeinfo); i++)
if (typeinfo[i])
ITypeInfo_Release(typeinfo[i]);
if (typelib)
ITypeLib_Release(typelib);
}
static HRESULT WINAPI fw_app_GetTypeInfo( static HRESULT WINAPI fw_app_GetTypeInfo(
INetFwAuthorizedApplication *iface, INetFwAuthorizedApplication *iface,
UINT iTInfo, UINT iTInfo,
......
...@@ -114,9 +114,9 @@ static hnetcfg_cf fw_manager_cf = { { &hnetcfg_cf_vtbl }, NetFwMgr_create }; ...@@ -114,9 +114,9 @@ static hnetcfg_cf fw_manager_cf = { { &hnetcfg_cf_vtbl }, NetFwMgr_create };
static hnetcfg_cf fw_app_cf = { { &hnetcfg_cf_vtbl }, NetFwAuthorizedApplication_create }; static hnetcfg_cf fw_app_cf = { { &hnetcfg_cf_vtbl }, NetFwAuthorizedApplication_create };
static hnetcfg_cf fw_openport_cf = { { &hnetcfg_cf_vtbl }, NetFwOpenPort_create }; static hnetcfg_cf fw_openport_cf = { { &hnetcfg_cf_vtbl }, NetFwOpenPort_create };
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved)
{ {
TRACE("(0x%p, %d, %p)\n",hInstDLL,fdwReason,lpvReserved); TRACE("(0x%p, %d, %p)\n", hInstDLL, fdwReason, reserved);
switch(fdwReason) { switch(fdwReason) {
case DLL_WINE_PREATTACH: case DLL_WINE_PREATTACH:
...@@ -125,6 +125,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -125,6 +125,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
instance = hInstDLL; instance = hInstDLL;
DisableThreadLibraryCalls(hInstDLL); DisableThreadLibraryCalls(hInstDLL);
break; break;
case DLL_PROCESS_DETACH:
if (reserved) break;
release_typelib();
break;
} }
return TRUE; return TRUE;
} }
......
...@@ -28,6 +28,7 @@ enum type_id ...@@ -28,6 +28,7 @@ enum type_id
}; };
HRESULT get_typeinfo(enum type_id, ITypeInfo **) DECLSPEC_HIDDEN; HRESULT get_typeinfo(enum type_id, ITypeInfo **) DECLSPEC_HIDDEN;
void release_typelib(void) DECLSPEC_HIDDEN;
HRESULT NetFwMgr_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; HRESULT NetFwMgr_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT NetFwPolicy_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; HRESULT NetFwPolicy_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
......
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