diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 4acb4f1a795..303cc30a931 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -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); } diff --git a/dlls/strmbase/dispatch.c b/dlls/strmbase/dispatch.c index 25573fa1a26..de817f20c0d 100644 --- a/dlls/strmbase/dispatch.c +++ b/dlls/strmbase/dispatch.c @@ -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); +} diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 6789957e50a..02a5469de17 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -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 {