I realize this is slightly off topic, but I’m stumped and since it’s a Steinberg plugin I’m hoping for a little insight.
I’m getting this error from Halion 7 in the host program (Cantabile) that I’m the developer on:
It happens in this scenario:
Load Halion module
Create 2 or more instances of the plugin
Close the 2 plugin instances
Unload the Halion module
On loading the Halion module again, during the call to InitDll the message above is displayed and InitDll returns false.
Attempting to load the module again crashes in the next call to InitDll.
If only a single instance is created in step 2 everything works fine.
Anybody have any clue what I might be doing wrong to cause this? I don’t see issues like this with any other plugins. What’s the “proper” way to reload a plugin?
I just checked the code and you get this message because the halion.dll was not unloaded from the process. This can only happen (as long as I know) when there are more LoadLibrary() calls than FreeLibrary() ones.
I had a bug in the module loading where on the second plugin instance it does a load library, checks the module handle in a table and if found doesn’t re-initialize it… but I forget to free that extra load library reference.