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; }