PluginHost, hidden instance?

When I run the PluginHost to debug plugins I’ve noticed debug printouts get doubled. Using a static counter I can verify that although I have only one instance created in the PluginHost there’s a hidden instance also running. This instance is left running also if I remove all plugins, including in/out from the host.

Seems like this instance is also always created first.
Can someone explain the reason for this?

I’ve not seen this behaviour before. It sounds very unusual.

  • If you stick a breakpoint in the constructor of your AudioProcessor, can you find out where the “hidden instance” is being created? Your debugger should be able to show you the stack trace.
  • Have you tested any of the JUCE example plugins? Do those exhibit the same problem?
  • Which plugin format (VST, VST3, AU, AUv3, etc.) are you using?

This was my extended version of the AudioProcessorTreeStateTutorial with AU on macOS.
I ended upp trashing the whole build folder, building everything again and then all became normal. So I could unfortunately not debug this.

But if it happens again I should follow your advice. However since the hidden instance started before any other instance, I guess I’ll have to start debugging very early in the process, but where is that for plugins? Is the Main.cpp (as presented in the tutorial, very short) executed in plugins or is that for the stand alone only? I’m not sure where a plugin instance is created.