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 Fri, 18 Jul 2008 10:34:25 GMT
Bojan Smojver wrote:
> On Fri, 2008-07-18 at 16:30 +1000, Bojan Smojver wrote:
>>   *r=apr_pcalloc(rpool,sizeof(**r));
> This should really be malloc()'ed and free in de().

Of course if you can do that. However things like
sockets and other APR objects depends on pools.
With standard cleanup they'll be destroyed before
de() is run.
pre_cleanup address those things. It should be used
in all cases where apr_object creates child pools.

For example apr_memcache.c leeks memory because
it doesn't call apr_pool_destroy in destructor
although it creates one in constructor.
(Probably because with standard cleanup it cores)


View raw message