From 0c64a01424a8a8209060df00d0c7a7a4b1c8ae74 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 4 Dec 2024 10:59:36 -0500 Subject: [PATCH] Call juce::PopupMenu::dismissAllActiveMenus in guiDestroy Recent version of JUCE do this in the VST2/3/AAX/AU wrappers so symmetrize with the call here. This went un-noticed in surge since we call it in the destructor of Surge GUI ourselves, from before the juce call was there. --- src/wrapper/clap-juce-wrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wrapper/clap-juce-wrapper.cpp b/src/wrapper/clap-juce-wrapper.cpp index 2cf6909..688f3f6 100644 --- a/src/wrapper/clap-juce-wrapper.cpp +++ b/src/wrapper/clap-juce-wrapper.cpp @@ -2076,7 +2076,11 @@ class ClapJuceWrapper : public clap::helpers::Plugin< void guiDestroy() noexcept override { - editorWrapper.reset(nullptr); + if (editorWrapper) + { + juce::PopupMenu::dismissAllActiveMenus(); + editorWrapper.reset(nullptr); + } guiParentAttached = false; }