diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 5a392a4746..2b6e980749 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -1365,7 +1365,9 @@ struct VST3PluginWindow : public AudioProcessorEditor, embeddedComponent.removeClient(); #endif - warnOnFailure (view->removed()); + if (attachedCalled) + warnOnFailure (view->removed()); + warnOnFailure (view->setFrame (nullptr)); processor.editorBeingDeleted (this); @@ -1573,7 +1575,12 @@ private: return; } - warnOnFailure (view->attached ((void*) pluginHandle, defaultVST3WindowType)); + const auto attachedResult = view->attached ((void*) pluginHandle, defaultVST3WindowType); + ignoreUnused (warnOnFailure (attachedResult)); + + if (attachedResult == kResultOk) + attachedCalled = true; + updatePluginScale(); } } @@ -1641,7 +1648,7 @@ private: #endif HandleFormat pluginHandle = {}; - bool recursiveResize = false, isInOnSize = false; + bool recursiveResize = false, isInOnSize = false, attachedCalled = false; ComponentPeer* currentPeer = nullptr; Steinberg::IPlugViewContentScaleSupport* scaleInterface = nullptr;