Bojan Smojver
Mon, 21 Jul 2008 14:30:18 -0700
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). -- Bojan