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

Re: use of svn_pool_ functions

From: Peter Lundblad <plundblad_at_google.com>
Date: 2006-10-13 16:24:25 CEST

Asbjørn Pettersen writes:
> I'm a little confused by the use of the svn_pool_create() and
> svn_pool_destroy() functions.
> The svn_pool_destroy() isn't always called !? especially on "subpools".
> The SVN_ERR() also return without calling destroy()
>
>
> Example:
> subversion/subversion/libsvn_client/checkout.c
>
> svn_client__checkout_internal()
> {
> // ....
> apr_pool_t *session_pool = svn_pool_create(pool);
>
> /* Get the RA connection. */
> SVN_ERR(svn_client__ra_session_from_path(&ra_session, &revnum,
> &session_url, url,
> peg_revision, revision, ctx,
> session_pool));
>
> SVN_ERR(svn_ra_check_path(ra_session, "", revnum, &kind, pool));
> if (kind == svn_node_none)
> // ------------- Why not a call destroy() here ?
> // svn_pool_destroy(session_pool);

Because the parent pool will destroy the subpool eventually, and in the
error case, this is expected to happen quite soon. This avoids code
cluttering a lot. There's some information of pool usage in hacking.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 13 16:24:53 2006

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.