When closing ProTools (version 10.3.3) on MacOS X (10.8.2) with the current JUCE tip I’m getting some leak assertions upon destruction of PluginInstanceInfo and its MidiBuffer and Array <float*> members.
This is happening because the memory where PluginInstanceInfo is stored is owned by the host and initialized with a “placed” new in ResetFieldData, and there is no explicit destruction of the members. The host simply deallocates that block of memory upon unloading the plugin.
So, instead of storing that MemoryBuffer and Array as members of PluginInstanceInfo, I’d move them into JuceAAX_Parameters and store in PluginInstanceInfo only their reference, the same way it is currently done for the AudioProcessor.
For the same reason, PluginInstanceInfo should be only JUCE_DECLARE_NON_COPYABLE instead of JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
Here is the patch as I’ve implemented it: https://github.com/yfede/JUCE/commit/8fc162ecc277fbefb331721d61633fa2a1d8e7bc
Maybe this helps in fixing the crashing issues when closing ProTools?