Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F977EE76 for ; Mon, 4 Feb 2013 20:07:46 +0000 (UTC) Received: (qmail 601 invoked by uid 500); 4 Feb 2013 20:07:46 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 582 invoked by uid 500); 4 Feb 2013 20:07:46 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 574 invoked by uid 99); 4 Feb 2013 20:07:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 20:07:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 20:07:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 85FFD2388980; Mon, 4 Feb 2013 20:07:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1442325 - /subversion/trunk/subversion/libsvn_wc/wc_db.c Date: Mon, 04 Feb 2013 20:07:26 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130204200726.85FFD2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Mon Feb 4 20:07:26 2013 New Revision: 1442325 URL: http://svn.apache.org/viewvc?rev=1442325&view=rev Log: Resolve the pool lifetime issue uncovered by committing r1442301. * subversion/libsvn_wc/wc_db.c (read_cached_iprops_baton_t): Remove baton. (db_read_cached_iprops): Use standard argument method as a baton is no longer needed with the new with transaction macro. (svn_wc__db_read_cached_iprops): Update caller. (db_read_inherited_props): Pass the right pool to db_read_cached_iprops, as we just shallow copy these values later in this function. Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1442325&r1=1442324&r2=1442325&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Feb 4 20:07:26 2013 @@ -9193,23 +9193,14 @@ svn_wc__db_prop_retrieve_recursive(apr_h return svn_error_trace(svn_sqlite__reset(stmt)); } -/* Baton for passing args to db_read_cached_iprops(). */ -struct read_cached_iprops_baton_t -{ - apr_array_header_t *iprops; - apr_pool_t *result_pool; -}; - -/* The body of svn_wc__db_read_cached_iprops(). - * - * (Not called in a txn, but implements svn_wc__db_txn_callback_t anyway.) */ +/* The body of svn_wc__db_read_cached_iprops(). */ static svn_error_t * -db_read_cached_iprops(void *baton, +db_read_cached_iprops(apr_array_header_t **iprops, svn_wc__db_wcroot_t *wcroot, const char *local_relpath, + apr_pool_t *result_pool, apr_pool_t *scratch_pool) { - struct read_cached_iprops_baton_t *rib = baton; svn_sqlite__stmt_t *stmt; svn_boolean_t have_row; @@ -9226,8 +9217,8 @@ db_read_cached_iprops(void *baton, scratch_pool)); } - SVN_ERR(svn_sqlite__column_iprops(&rib->iprops, stmt, 0, - rib->result_pool, scratch_pool)); + SVN_ERR(svn_sqlite__column_iprops(iprops, stmt, 0, + result_pool, scratch_pool)); SVN_ERR(svn_sqlite__reset(stmt)); @@ -9243,7 +9234,6 @@ svn_wc__db_read_cached_iprops(apr_array_ { svn_wc__db_wcroot_t *wcroot; const char *local_relpath; - struct read_cached_iprops_baton_t rcib; SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath)); @@ -9252,14 +9242,11 @@ svn_wc__db_read_cached_iprops(apr_array_ scratch_pool, scratch_pool)); VERIFY_USABLE_WCROOT(wcroot); - rcib.result_pool = result_pool; - /* Don't use with_txn yet, as we perform just a single transaction */ - SVN_ERR(db_read_cached_iprops(&rcib, wcroot, local_relpath, scratch_pool)); + SVN_ERR(db_read_cached_iprops(iprops, wcroot, local_relpath, + result_pool, scratch_pool)); - if (rcib.iprops) - *iprops = rcib.iprops; - else + if (!*iprops) { *iprops = apr_array_make(result_pool, 0, sizeof(svn_prop_inherited_item_t *)); @@ -9328,21 +9315,17 @@ db_read_inherited_props(apr_array_header if (is_switched || is_wc_root) { - struct read_cached_iprops_baton_t rib; is_wc_root = TRUE; - rib.result_pool = scratch_pool; - /* If the WC root is also the root of the repository then by definition there are no inheritable properties to be had, but checking for that is just as expensive as fetching them anyway. */ /* Grab the cached inherited properties for the WC root. */ - SVN_ERR(db_read_cached_iprops(&rib, wcroot, parent_relpath, - iterpool)); - - cached_iprops = rib.iprops; + SVN_ERR(db_read_cached_iprops(&cached_iprops, + wcroot, parent_relpath, + result_pool, iterpool)); } /* If PARENT_ABSPATH is a true parent of LOCAL_ABSPATH, then