apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: Changing the order of cleanup for some core objects
Date Mon, 21 Jul 2008 21:29:45 GMT
On Mon, 2008-07-21 at 10:11 -0700, Chris Darroch wrote:

>    See also the notes in mod_dbd.c in dbd_setup() and the workaround
> involving the destructor dbd_destruct(), a flag variable, and
> a second cleanup function dbd_destroy() registered on the parent pool
> (i.e., P) after the reslist is created.

Or you can malloc() the resource container in the constructor (i.e. rec
in dbd_construct()) and then free() it in destructor. That way you know
it will outlive anything that may have been whacked. And regular cleanup
(dbd_close() in this case) can then simply zero the sub-pool pointer,
signalling to destructor that this pool has already been whacked. So,
you save the group->destroyed flag. You may even be able to avoid
per-group pools this way, given that reslists get created once only in
child_init() (i.e. are not dynamic, so no need to create/destroy these
pools for the duration of the process).


View raw message