Hey Jules
I have a class that is derived from DeletedAtShutdown and uses the juce_DeclareSingleton macro that’s not exactly behaving the right way. I have “allowOnlyOneInstance” set to true… When the last plug-in is deleted and my class is deleted it never comes back when a new plug-in gets created. Is this correct? I’m using the static getInstance() method to create it in my filter constructor.
TestFilter::TestFilter()
{
MyClass::getInstance();
}
I’ve set-up a couple of break-points in my singleton/DeletedAtShutdown class, one in the constructor and one in the destructor, just to make sure I’m not going bonkers here, and this is what I’m getting:
-
Instantiate (First Plug-In)
The singleton/DeletedAtShutdown class constructor gets called. (Correct) -
Instantiate (Second Plug-In)
The singleton/DeletedAtShutdown class constructor does NOT get called. (Correct, only one instance allowed) -
Delete (First Plug-In)
The singleton/DeletedAtShutdown class destructor does NOT get called. (Correct, one more plugin exists) -
Delete (Second Plug-In)
The singleton/DeletedAtShutdown class destructor gets called. (Correct, deleted at shutdown) -
Instantiate (New Plugin)
The singleton/DeletedAtShutdown class constructor does NOT get called. (?)
Does that look right?
Thank You