SharedResourcePointer accross Host / Plugin


Hey all -


I have been using a SharedReourcePointer for all my global-type objects for a while now.

It is incredibly convenient, and so far, flawless.

But - I did realize today that when I include it in a plugin host, and also in plugins which will be scanned by the host, the plugin creates a new instance of the sharedPointer. I assume this is because the plugin(s) have a different static space than the DAW/Host itself.

This would be fine, except that when the plugin is destroyed, it destoys the SharedReourcePointer, which seems to destroy both instances?

I'm not completely sure, but I end up with a memory leaked MessageManager, and then a crash on [NSApp run];.

Anyway - trying to wrap my head around this, so any info would be useful.






Ahhhh ... hang on .. this only happens when the plugin (and host) are running in Debug mode.

I vaguely remember posts about this before. Multiple plugins in debug mode causes some nasty issues.

Hmmm ..ok, disregard the previous question I guess.

Yeah, when you have debug symbols, the dynamic linker can mess things up by cross-linking the wrong modules sometimes.