From c224c8483e871cce703f7fa0db986e526270de25 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Thu, 1 Aug 2019 06:36:22 +0200 Subject: [PATCH] Fix macOS crash on editor closed and reopened On Minihost Modular, the window will not be recreated correctly after closing. It's because the host does not send the effEditClose opcode. When effEditOpen is reentered, fVstUI!=nullptr would short-circuit the initialization of the editor, and continue without an existing window. --- distrho/src/DistrhoPluginVST.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp index d8e7640f..12752306 100644 --- a/distrho/src/DistrhoPluginVST.cpp +++ b/distrho/src/DistrhoPluginVST.cpp @@ -588,7 +588,8 @@ public: return 1; case effEditOpen: - if (fVstUI == nullptr) + delete fVstUI; // hosts which don't pair effEditOpen/effEditClose calls (Minihost Modular) + fVstUI = nullptr; { # if DISTRHO_OS_MAC if (! fUsingNsView)