[gmpi] Re: Linux C++ question

On Thu, Feb 24, 2005 at 06:56:55PM -0500, Paul Davis wrote:
> >Unloading the DLL without calling ::Release() on every object from that
> >DLL is a logic bug.  The same as you would not deref a pointer after
> >free(), you don't want to do ANYTHING with a DLL after you unload it.

> for example, suppose you want to just unload the DLL very simply. you
> could just call the DLL's unload function, which could ::Release()
> every current instance of the plugins from the DLL. each ::Release()
> could tell any interested parties that the plugin instance is
> vanishing, and they can clean up.

This means that the plugins need to be really smart about being able to
voluntarily die at any time, and the host needs to be able to handle a
plugin going away at any time.  That sounds like a nightmare.

> the more "C" way of doing this is closer to what you propose: the host
> has to track every instance, and ::Release() them. the problem is that
> when there are multiple ways to cause resources to become deallocated,
> assuming the use of just one those ways is a possible source of
> danger.

This way is the way that seems sane to me.  The *host* knows when it is
safe to destroy a plugin.  The *host* is the owner of plugin instances.
The *host* is the thing that will be loading.unloading DLLs.

Maybe there is a sane alternative, but this is the obvious answer, isn;t
it?


----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: