Browse Source

AUv3: Ensured that the AudioProcessor's editor is released when the AUv3 view controller is de-allocated

tags/2021-05-28
hogliux 8 years ago
parent
commit
c430b03efa
1 changed files with 15 additions and 2 deletions
  1. +15
    -2
      modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm

+ 15
- 2
modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm View File

@@ -337,8 +337,7 @@ public:
auto& processor = getAudioProcessor(); auto& processor = getAudioProcessor();
processor.removeListener (this); processor.removeListener (this);
if (AudioProcessorEditor* editor = processor.getActiveEditor())
processor.editorBeingDeleted (editor);
removeEditor (processor);
if (editorObserverToken != nullptr) if (editorObserverToken != nullptr)
{ {
@@ -788,6 +787,17 @@ public:
return true; return true;
} }
static void removeEditor (AudioProcessor& processor)
{
ScopedLock editorLock (processor.getCallbackLock());
if (AudioProcessorEditor* editor = processor.getActiveEditor())
{
processor.editorBeingDeleted (editor);
delete editor;
}
}
private: private:
//============================================================================== //==============================================================================
struct BusBuffer struct BusBuffer
@@ -1308,6 +1318,9 @@ public:
~JuceAUViewController() ~JuceAUViewController()
{ {
jassert (MessageManager::getInstance()->isThisTheMessageThread()); jassert (MessageManager::getInstance()->isThisTheMessageThread());
if (processorHolder != nullptr)
JuceAudioUnitv3::removeEditor (getAudioProcessor());
} }
//============================================================================== //==============================================================================


Loading…
Cancel
Save