My audio plugin  works… sometimes. The problem is that sometimes it gets initialised incorrectly.
I run it in JUCE’s “Plugin Host.app”. When I add my VST3 plugin to the host, I notice that my PluginProcessor’s constructor gets called twice. So my private
initialiseSynth() gets invoked twice, and finds that it has already been initialised before. Sometimes it survives this fine, other times I end up with segfaults when I rely on the data that I’ve constructed.
Here’s the exact code of my PluginProcessor:
These are the two stack traces I captured — the two times that my constructor was invoked. It seems that
juce::VST3PluginFormat::createPluginInstance() is the common ancestor. Once inside that function, it constructs my audio plugin twice. Is this normal?
 It’s a simple synthesizer that takes MIDI input, uses fluidsynth to render each block through a soundfont.