Hi everyone,
This is not a JUCE specific problem but it is related to how audio plug-ins are loaded so I suppose it is relevant for some of you.
I’m bringing in the AWS C++ SDK to my project. This SDK is initialised using a static initialise/cleanup function. I’ve created a small RAII class wrapped in a SharedResourcePointer that calls the init and cleanup.
I’m experiencing strange crashes in my plug-in. This is the situation:
When I load multiple VST3 instances, then delete them all and load an AU, it crashes.
When I load multiple AU instances, then delete them all and load a VST3, it crashes.
When I load multiple VST3 instances, then delete them all and load a VST3, it’s fine.
When I load multiple AU instances, then delete them all and load a AU, it’s fine.
I decided to build AWS SDK as a static library in order to simplify the deployment of the product because I wouldn’t need to ship the shared library with the product. The crash is not happening when I build the SDK as a shared library (.dylib).
Just before the crash, an assert happens on assert(s_configManager);
in the ConfigAndCredentialsCacheManager.cpp
(AWS SDK). The value of s_configManager is only changed during initialisation and cleanup of the API so this is defenitly where things go wrong.
I’m not expecting people here to be experts at AWS SDK, but I’m hoping that someone could give me a lead to what the problem could be. I know that singletons and plug-ins aren’t best friends, but I’ve never experienced this weird behaviour before.
Thank you,
Jelle