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


Loading…
Cancel
Save