apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c
Date Thu, 17 Jul 2008 10:25:14 GMT
Bojan Smojver wrote:
 > Quoting mturk@apache.org:
 >
 >> 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


Mime
View raw message