Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/main.c | 21 ++++++++++++--------- dlls/qedit/mediadet.c | 1 - dlls/qedit/qedit_private.h | 1 + dlls/qedit/samplegrabber.c | 1 - 4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/dlls/qedit/main.c b/dlls/qedit/main.c index f4d1bbb061..cc5da4edf5 100644 --- a/dlls/qedit/main.c +++ b/dlls/qedit/main.c @@ -23,15 +23,18 @@
WINE_DEFAULT_DEBUG_CHANNEL(qedit);
-static HINSTANCE instance; +static HINSTANCE qedit_instance;
-BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { - switch(fdwReason) { - case DLL_PROCESS_ATTACH: - instance = hInstDLL; - DisableThreadLibraryCalls(hInstDLL); - break; + if (reason == DLL_PROCESS_ATTACH) + { + qedit_instance = instance; + DisableThreadLibraryCalls(instance); + } + else if (reason == DLL_PROCESS_DETACH) + { + strmbase_release_typelibs(); } return TRUE; } @@ -243,7 +246,7 @@ HRESULT WINAPI DllRegisterServer(void) IFilterMapper2 *mapper; HRESULT hr;
- if (FAILED(hr = __wine_register_resources( instance ))) + if (FAILED(hr = __wine_register_resources(qedit_instance))) return hr;
if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, @@ -267,7 +270,7 @@ HRESULT WINAPI DllUnregisterServer(void) IFilterMapper2 *mapper; HRESULT hr;
- if (FAILED(hr = __wine_unregister_resources( instance ))) + if (FAILED(hr = __wine_unregister_resources(qedit_instance))) return hr;
if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, diff --git a/dlls/qedit/mediadet.c b/dlls/qedit/mediadet.c index d32679b6bb..e1defaa9a6 100644 --- a/dlls/qedit/mediadet.c +++ b/dlls/qedit/mediadet.c @@ -28,7 +28,6 @@ #include "ole2.h"
#include "qedit_private.h" -#include "wine/strmbase.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(qedit); diff --git a/dlls/qedit/qedit_private.h b/dlls/qedit/qedit_private.h index 7011c9f70d..0c0655084d 100644 --- a/dlls/qedit/qedit_private.h +++ b/dlls/qedit/qedit_private.h @@ -32,6 +32,7 @@ #include "winuser.h" #include "dshow.h" #include "qedit.h" +#include "wine/strmbase.h"
HRESULT timeline_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT media_detector_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index bd8480df48..1619111f95 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -29,7 +29,6 @@
#include "qedit_private.h" #include "wine/debug.h" -#include "wine/strmbase.h"
WINE_DEFAULT_DEBUG_CHANNEL(qedit);