Singletons and multiple instances


#1

I seem to remember using a singleton in a plugin experiment as a way of sharing data between instances of a plugin.

I can’t remember exactly what happened, but i think it ended up working. Is it safe to use a singleton in a plugin? My goal is for it NOT to share information between instances… i’m concerned that it may cause problems when it comes to closing an instance of the plugin (i.e. the plug should tidy away the singleton instance, but would this cause the destruction of the singleton used in other plugin instances?)


#2

If you make it inherit from DeletedOnShutdown, then that would work fine, as it’ll be deleted only when the dll is removed from memory (or when all the plugins are deleted on the mac)


#3