apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <s.stri...@striker.nl>
Subject Re: svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c
Date Thu, 17 Jul 2008 10:37:05 GMT
On Thu, Jul 17, 2008 at 12:25 PM, Mladen Turk <mturk@apache.org> wrote:
> 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.

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

Mime
View raw message