Zebediah Figura : evr: Free type libraries on process detach (Valgrind).
Alexandre Julliard
julliard at winehq.org
Mon Jun 8 15:19:56 CDT 2020
Module: wine
Branch: master
Commit: 17529582402ebe27ef975fc7dcb8353f4f95e629
URL: https://source.winehq.org/git/wine.git/?a=commit;h=17529582402ebe27ef975fc7dcb8353f4f95e629
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sun Jun 7 17:23:32 2020 -0500
evr: Free type libraries on process detach (Valgrind).
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/evr/evr.c | 1 -
dlls/evr/evr_private.h | 1 +
dlls/evr/main.c | 19 +++++++++----------
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
index 911075de33..001839026b 100644
--- a/dlls/evr/evr.c
+++ b/dlls/evr/evr.c
@@ -24,7 +24,6 @@
#include "evr_private.h"
#include "d3d9.h"
-#include "wine/strmbase.h"
#include "initguid.h"
#include "dxva2api.h"
diff --git a/dlls/evr/evr_private.h b/dlls/evr/evr_private.h
index 65dcbb7a9b..ad47bd28b7 100644
--- a/dlls/evr/evr_private.h
+++ b/dlls/evr/evr_private.h
@@ -21,6 +21,7 @@
#include "dshow.h"
#include "evr.h"
+#include "wine/strmbase.h"
HRESULT evr_filter_create(IUnknown *outer_unk, void **ppv) DECLSPEC_HIDDEN;
diff --git a/dlls/evr/main.c b/dlls/evr/main.c
index 000ed7c55b..921e63535f 100644
--- a/dlls/evr/main.c
+++ b/dlls/evr/main.c
@@ -36,18 +36,17 @@ static HINSTANCE instance_evr;
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
- TRACE("(%p, %d, %p)\n", instance, reason, reserved);
-
- switch (reason)
+ if (reason == DLL_WINE_PREATTACH)
+ return FALSE; /* prefer native version */
+ else if (reason == DLL_PROCESS_ATTACH)
{
- case DLL_WINE_PREATTACH:
- return FALSE; /* prefer native version */
- case DLL_PROCESS_ATTACH:
- instance_evr = instance;
- DisableThreadLibraryCalls(instance);
- break;
+ instance_evr = instance;
+ DisableThreadLibraryCalls(instance);
+ }
+ else if (reason == DLL_PROCESS_DETACH && !reserved)
+ {
+ strmbase_release_typelibs();
}
-
return TRUE;
}
More information about the wine-cvs
mailing list