There seems to be a problem with the way the audioMasterCallback is stored in the current implementation. This sometimes causes the plugin to hang the host under certain circumstances.
To reproduce:
(works with IPluginExample):
Set the ProcessDoubleReplacing-implementation to ask for host information, for example sample position:
void PlugExample::ProcessDoubleReplacing (double** inputs, double** outputs, int sampleFrames)
{
WDL_MutexLock lock(&mMutex);
int samplePos = GetSamplePos();
}
Create two instances of the plugin. Deleting the first works fine. Trying to deleting the second hangs my host (Live 7). Note: Both instances of the plugin will happily coexist until you delete one of them.
(I'm not intimately familiar with how DLL handles static resources, but I think this might be the problem. I tried heap-allocating some memory to hold the callback, but I was unable to get it to work.)
Workaround:
It's not difficult to work around this problem by passing the audioMasterCallback to the IPlug-instance (I'm currently doing this for my own plugin). This makes the IPlug-interface VST specific, tho. I'll leave it up to you to figure out a smart way to fix this in a platform agnostic way.