You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Erik Lotspeich <er...@lotspeich.org> on 2008/01/09 07:03:41 UTC

Re: Help: How to call function on Apache quitA

Hi Nick,

I continued some testing and it seems that the pool cleanup mechanism does not 
work.  Here's my cleanup register call:

	apr_pool_cleanup_register(s->process->pool, mydata, proc_cleanup,
				  apr_pool_cleanup_null);

My cleanup function, proc_cleanup() never gets called when I quit Apache.

Is there something else that I can do?

Regards,

Erik.

On Thursday 15 November 2007 02:22, Nick Kew wrote:
> On Thu, 15 Nov 2007 00:15:17 -0800 (PST)
>
> Erik Lotspeich <er...@lotspeich.org> wrote:
> > The basic question is: how to execute code when Apache quits.
>
> Register a cleanup function on the process pool.

Re: Help: How to call function on Apache quitA

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
Erik Lotspeich wrote:
> 
> I continued some testing and it seems that the pool cleanup mechanism does not 
> work.

Of course, it does.

>  Here's my cleanup register call:
> 
> 	apr_pool_cleanup_register(s->process->pool, mydata, proc_cleanup,
> 				  apr_pool_cleanup_null);
> 
> My cleanup function, proc_cleanup() never gets called when I quit Apache.

It does (look for a core file ;-)

Your *loadable* module doesn't survive to the end of the proc pool
because it's codepages were already unloaded.  Be careful.