--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "brucexs" <bswitzer@> wrote:
> >
> > --- In [email protected], "entropyreduction" 
> > <alancampbelllists+yahoo@> wrote:
>  
> > 
> > If plugin has an external entry point
> > void pproshutdown(void)
> > it gets called at pproshutdown.  Only plugins loaded directly by PowerPro 
> > and still loaded at shutdown will get called.  Calls happen after 
> > pproshutdown list processing, so if there is an unload there, then the call 
> > to pproshutdown entry point should not happen.  Note not arguments to call 
> > to pproshutdown and that name must be lower case.
> 
> I wonder if I should do same in plugins that load other plugins: test to see 
> if they were loaded already, if they were assume someone else will call 
> pproshutdown(); if they weren't, when calling plugin exits, call pproshutdown 
> and unload the dependent plugin's dll.  
> 
> What that doesn't deal with is situation where dependent plugin wasn't 
> already loaded when using plugin gets loaded, but then starts to be directly 
> used by script.  I could then be unloading dll when it was still required.  
> Hmm.
>


Maybe have a global boolean bShutdownDone which is checked before executing 
shtudown code in a common routine which is called from all of pproshutdown, dll 
shutdown (for people who have not upgraded powerpro.exe) and unload process.  
That way is always gets down once.  And yes if you load another plugin then you 
own calling pproshutdown.  PowerPro keeps the hModule of all loaded plugins.  
Then when shutdown is processed, if getprocaddress says an hmodule has an entry 
point pproshutdown, then it does not harm to call it.

BTW, none of my plugins will be changed to use pproshutdown entry as all I do 
is release memory in dll_detach which seems to be safe.




Reply via email to