quartz: Free type libraries on process detach (Valgrind).

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-06-07 17:23:29 -05:00 committed by Alexandre Julliard
parent 9e87c6826e
commit 4beda16757
3 changed files with 18 additions and 1 deletions

View File

@ -31,8 +31,11 @@ LONG object_locks = 0;
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
{
if (reason == DLL_PROCESS_DETACH)
if (reason == DLL_PROCESS_DETACH && !reserved)
{
video_window_unregister_class();
strmbase_release_typelibs();
}
return QUARTZ_DllMain(instance, reason, reserved);
}

View File

@ -68,3 +68,16 @@ HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **ret)
ITypeInfo_AddRef(*ret = control_typeinfo[tid]);
return S_OK;
}
void strmbase_release_typelibs(void)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(control_typeinfo); ++i)
{
if (control_typeinfo[i])
ITypeInfo_Release(control_typeinfo[i]);
}
if (control_typelib)
ITypeLib_Release(control_typelib);
}

View File

@ -252,6 +252,7 @@ enum strmbase_type_id
};
HRESULT strmbase_get_typeinfo(enum strmbase_type_id tid, ITypeInfo **typeinfo);
void strmbase_release_typelibs(void);
struct strmbase_passthrough
{