Segfault when trying to close a filter's Editor after audioProcessorParameterChanged().



I'm blocking on a problem that occurs on MacOS (works fine on windows) :

I got a documentWindow that contains an external VST's Editor --> I called setContentOwned(), passing the Editor's component generated by AudioProcessor::createEditorIfNeeded().
And I'd like to close this window, in some case, when I catch an AudioProcessorListener::audioProcessorParameterChanged() event.

But because the event is catched at mouseDown, if I close the window I got this segfault :

"Thread 1: EXC_BAD_ACCESS (code=2, adress=0x0)"  in juce_VSTPluginFormat.cpp, on line 1427 (inside function dispatch():

result = effect->dispatcher (effect, opcode, index, value, ptr, opt);

Here his my call stack on Thread 1 :

        #0    0x0f34915e in TalVstEditor::idle()
        #2    0x0f368dec in AudioEffectX::dispatcher(int, int, int, void*, float) ()
        #3    0x0d90125e in juce::VSTPluginInstance::dispatch(int, int, int, void*, float) const at ***/juce_VSTPluginFormat.cpp:1427
        #4    0x0d945d9e in juce::VSTPluginInstance::handleCallback(int, int, int, void*, float) at ***/juce_VSTPluginFormat.cpp:1280
        #5    0x0d8ff415 in juce::audioMaster(juce::AEffect*, int, int, int, void*, float) at ***/juce_VSTPluginFormat.cpp:2624
        #6    0x0f3670e1 in AudioEffect::masterIdle()
        #48    0x000030a2 in _start ()

I guess it's because something in the system has suscribed for a mouseUp event.
So I tried to find a way to catch a mouseUp on my documentWindow (then I could close my window only after mouseUp).
But it seems that there is no way to catch a mouse event that occurs on the filter's Editor. It works fine if my window hosts a standard JUCE component, by doing getContentComponent()->addMouseListener(this, true), but it doesn't work whith filter's Editor.

I'd like to know if there's a way either to fix this segfault (since it works on Windows), or make my documentWindow catch a mouseUp event from the hosted filter's Editor ?

Thank in advance !