Hello,
I have a plugin which advertises itself as a server to receive audio from other sources. In the destructor I need to shut down the server and terminate the advertisement.
The problem is that with VST3, it seems that sometimes terminate () can be called by the host when a plugin is removed from a track, but release () is never called, so the plugin never actually gets destructed. I’ve encountered this in both DP and Steinberg’s VST3PluginTestHost.
Terminate does call AudioProcessor::releaseResources (), but this is not an appropriate place to take down the server and advertisement. In the AAX version, releaseResources () only gets called when the plugin is removed from a track, right before its destructed, so in this case, taking down the server in releaseResources () would be fine.
However in the Juce Plugin Host and Logic, releaseResources can be called any time the block size, sample rate, or processing precision changes, in which case I absolutely would not like to close all the connections to my plugin, take down the server, and terminate the advertisement.
In this case, there’s no real solution, except to tell users NOT to use the VST3 version in DP or modify the JUCE SDK and add a AudioProcesser::terminate () method for cases when a VST host terminates my plugin but doesn’t bother to release it.
What would be great is if the JuceVST3Component could actually delete the plugin instance when terminate was called and create a new instance when initialize is called, if there is no instance. I tried releasing the plugin in JuceVST3Component::terminate (), but then we crash in JuceVST3Component::initialize () as getPluginInstance () simply returns a pointer and won’t construct the plugin if it doesn’t already exits.
Or at least I would wish for some solution where I actually know when my VST3 plugin is being removed from a host which is distinguishable from the host just changing the block size or sample rate.
Thanks,
Best,
Joe