Not sure if I am doing something wrong or if this is intended as it is necessary for plugin scanning, but in VSTPluginInstance gets called twice when I host a VST2 plugin.
//here it gets called for the first time, then it is destroyed
for (int i = 0; i < pluginFormatManager.getNumFormats(); ++i)
plist.scanAndAddFile(pluginPath, true, pluginDescriptions, *pluginFormatManager.getFormat(i));
juce::String msg;
//here it gets called for the second time
auto wrapped = pluginFormatManager.createPluginInstance(*pluginDescriptions[0], 44100.0, 512, msg);
return std::make_unique<WrapperProcessor>(std::move(wrapped)).release();