Just wanted to see if I could shed some light on the best way to address an issue that I don't fully understand in my audio unit plugin. I'm currently working on developing a parameter management system for a plugin I'd like to make a bit further down the line, and I'm prototyping this system with a really simple gain/pan plugin. I noticed some strange behavior that I can't quite wrap my head around:
I have an editable Label that, when focused and acting as a TextEditor, seems to trigger a jassert ("there's some kind of component currently modal, but the host is trying to delete our plugin..") in juce_AU_wrapper.mm when I try to close the Audio Unit plugin in my host (Logic).
I'm trying to figure out the best way to handle this. Currently I'm adding the following before the jassert:
if (Component::getCurrentlyModalComponent()) Component::getCurrentlyModalComponent()->exitModalState(1); jassert (Component::getCurrentlyModalComponent() == nullptr);
This gets rid of the modal state of the Label Texteditor in the shutdown function in the JuceUIViewClass struct of juce_wrapper_au, but I REALLY don't understand exactly what's happening in the AU wrapper and I'm loathe to mess with it anymore - I'd really like to do this kind of "cleanup" work in the actual plugin code, but adding this code to either the AudioProcessor or AudioProcessorEditor destructors doesn't solve the problem.