IMessages and multiple instances

I notice that sendMessage and sendTextMessage are being sent to the wrong processor / controller pair when I have multiple instances of my plugin open. How do I direct my messages between the correct processor / controller?

That sounds like a bug in the DAW you are using since there is nothing you can do to direct messages yourself. Did you try with a different DAW (or the VST3PluginTestHost application)?

Thank-you for your reply. I think the DAW is not the issue (tried in a few). It must be something in my code-- like an ID hasn’t been properly set and is defaulting to zero.

I had a pointer to my editor declared in global space. Moved it into my controller class and all is well.

:warning:Take care about global variables: there are shared between all instances of your plugin (if there are in the same process)

Ya, I ended up changing that to a member variable. But even then it was occasionally crashing in release builds.

I resolved the issue completely by having the controller send a message to the processor just before termination to tell it to stop sending parameter changes.