Sander Striker
Thu, 17 Jul 2008 03:37:38 -0700
On Thu, Jul 17, 2008 at 12:25 PM, Mladen Turk <[EMAIL PROTECTED]> wrote: > Bojan Smojver wrote: >> Quoting [EMAIL PROTECTED]: >> >>> Use apr_pool_pre_cleanup_register for reslist cleanup >> >> After thinking about this a bit more, this patch may introduce a >> somewhat unusual (possibly even dangerous) behaviour, as it changes the >> way cleanups normally work with APR pools. >> > > It only forces calling resource destructors before > its subpools are destroyed. > The operation is exactly the same as if one would explicitly > call destructors for each resource before calling pool_destroy. > So the pool P is not destroyed before its subpools, only > the callback is called before subpools are destroyed. Yes, which is a difference in ordering, as this cleanup on the parent pool, is called prior to cleanups on all child pools. I can see what Bojan is getting at. > The standard cleanup on pool_clear(destroy) first destroys > all subpools and then call register cleanups. > This forces (just look at mod_proxy connection pool code) > the user to make some tricks so it can figure out weather > the destructor was called by invalidate or by pool destroy. > If it was by pool destroy then it must skip any subpool > destroy calls, because those would cause core. Cheers, Sander