From 46792aaa457c0247e1479392c1e9128502c1ba15 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 2 Jan 2024 19:53:37 +0100 Subject: [PATCH] Fix winevst for DLL_PROCESS_ATTACH Signed-off-by: falkTX --- source/plugin/carla-vst-export-bridged.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugin/carla-vst-export-bridged.cpp b/source/plugin/carla-vst-export-bridged.cpp index 14d53b60c..219f4aebd 100644 --- a/source/plugin/carla-vst-export-bridged.cpp +++ b/source/plugin/carla-vst-export-bridged.cpp @@ -43,7 +43,8 @@ static HINSTANCE getCurrentModuleInstanceHandle() noexcept CARLA_PLUGIN_EXPORT BOOL WINAPI DllMain(HINSTANCE hInst, DWORD, LPVOID) { - currentModuleHandle = hInst; + if (reason == DLL_PROCESS_ATTACH) + currentModuleHandle = hInst; return 1; }