Mladen Turk
Thu, 17 Jul 2008 03:25:56 -0700
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. 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. Regards -- ^TM