From e3c3abe3b285acccabc8ed4f770a6636e4576690 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 4 Dec 2024 14:06:32 -0500 Subject: [PATCH] Call juce::PopupMenu::dismissAllActiveMenus in guiDestroy (#156) 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; }