From ac3c8aacb4c7b7d8c33b8ae55c8d90eaead1ad81 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 19 May 2020 02:37:42 +0100 Subject: [PATCH] Tweak previous commit to work under plugin bridges too Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginVST2.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/backend/plugin/CarlaPluginVST2.cpp b/source/backend/plugin/CarlaPluginVST2.cpp index 7f0b109f4..9a21f0d33 100644 --- a/source/backend/plugin/CarlaPluginVST2.cpp +++ b/source/backend/plugin/CarlaPluginVST2.cpp @@ -2419,25 +2419,27 @@ public: sCurrentUniqueId = static_cast(uniqueId); sLastCarlaPluginVST2 = this; - bool wasTriggered; + bool wasTriggered, wasThrown = false; { const ScopedAbortCatcher sac; try { fEffect = vstFn(carla_vst_audioMasterCallback); - } CARLA_SAFE_EXCEPTION_RETURN("Vst init", false); + } CARLA_CATCH_UNWIND catch(...) { + wasThrown = true; + } wasTriggered = sac.wasTriggered(); } // try again if plugin blows - if (wasTriggered) + if (wasTriggered || wasThrown) { const ScopedAbortCatcher sac; try { fEffect = vstFn(carla_vst_audioMasterCallback); - } CARLA_SAFE_EXCEPTION_RETURN("Vst init", false); + } CARLA_SAFE_EXCEPTION_RETURN("VST init 2nd attempt", false); } sLastCarlaPluginVST2 = nullptr;