I’m running the develop branch downloaded October 14. MacOS.
What I just noticed is that right-clicking on my plugin and choosing “delete this filter” removes it from the staging area, but does NOT actually delete it. My AudioProcessor destructor is never called.
When I quit the APH, that is when my destructor gets called.
Still looking into this issue. For now, however, any change to the graph after having removed your plug-in from the graph, will actually call your destructor. So, for example, after having removed your plug-in, simply add one of the internal plug-ins to the graph.
Very good question. I might have been overly cautious, but it’s key here that the audio thread picks up the graph changes before the timer thread can delete the old state. If the audio thread takes a long time to run, and Timer::callAfterDelay() fires before, then the plug-in will never be deleted again.
Audio graphs are not limited to only real-time scenarios and we don’t want to restrict the way JUCE developers use them. It’s conceivable that in certain non-realtime scenarios (for example, offline rendering etc) the audio thread may block for a unknown amount of time.