From ff021d05812766b69fccd53ec8c40eb38ea054a6 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 13 Nov 2020 17:08:41 +0100 Subject: [PATCH] Work around editor opening bug in Ardour 6.3 --- CHANGELOG.md | 2 ++ src/wine-host/bridges/vst2.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1adb789..0b905bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed +- Added a workaround for a bug in Ardour 6.3 which would cause several plugins + to crash when opening the editor. - Fixed linking error in debug build related to the parallel STL. ## [2.0.1] - 2020-11-08 diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index 761e71bc..8fc30599 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -298,6 +298,21 @@ void Vst2Bridge::handle_dispatch() { plugin, [&](AEffect* plugin, int opcode, int index, intptr_t value, void* data, float option) -> intptr_t { + // HACK: Ardour 6.3 will call `effEditIdle` before + // `effEditOpen`, which causes some plugins to + // crash. This should be reported to Ardour's + // issue tracker. + if (opcode == effEditIdle && !editor) { + std::cerr << "WARNING: The host is calling " + "`effEditIdle()` while the " + "plugin's editor is closed, " + "filtering the request (is " + "this Ardour?). This bug should " + "be reported to the host." + << std::endl; + return 0; + } + // Certain functions will most definitely involve the // GUI or the Win32 message loop. These functions have // to be performed on the thread that is running the IO