[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Leaking temporary resources

From: Greg Stein <gstein_at_gmail.com>
Date: Sat, 18 Sep 2010 15:57:32 -0400

We've never been very focused on those kinds of "leaks", on the
assumption that the parent or child pool will be cleared at some
point, thus free'ing the handle.

Cheers,
-g

On Sat, Sep 18, 2010 at 13:47, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> http://colabti.org/irclogger/irclogger_log/svn-dev?date=2010-09-07#l40
> describes a scenario where a file handle would be leaked due to a pool
> not being freed; specifically,
>
>        parent(pool) calls child(pool);
>        child(pool) allocates handle from POOL;
>        child(pool) triggers an SVN_ERR();
>        handle remains allocated.
>
> Are there any other cases where this would be a problem?
>
>
> Should we adopt a strategy of
>
>        #define SVN_ERR_CLEAR(expr, scratch_pool)
>                do {
>                        svn_error_clear(scratch_pool);
>                        SVN_ERR(expr);
>                } while(0)
>
> at least in some functions taking a scratch_pool argument?
>
>
> (We could have this only for maintainer-mode builds, and
> #define SVN_ERR_CLEAR(expr, pool) SVN_ERR(expr)
> for normal builds.)
>
>
Received on 2010-09-18 21:58:24 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.