summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2008-07-17 05:45:57 +0000
committermturk <mturk@13f79535-47bb-0310-9956-ffa450edef68>2008-07-17 05:45:57 +0000
commit12ce5a1a0bec482d49db950b632c6b6c04ea4c90 (patch)
treee147d99d89efc89d10c0c7f8b308621b7051aa84
parent6dd340aadc4fa0e98cdf0a5174881a62c9a71971 (diff)
downloadlibapr-util-12ce5a1a0bec482d49db950b632c6b6c04ea4c90.tar.gz
Use apr_pool_pre_cleanup_register for reslist cleanup
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@677505 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--misc/apr_reslist.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/misc/apr_reslist.c b/misc/apr_reslist.c
index d26c948d..e6352cb5 100644
--- a/misc/apr_reslist.c
+++ b/misc/apr_reslist.c
@@ -277,8 +277,15 @@ APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist,
return rv;
}
- apr_pool_cleanup_register(rl->pool, rl, reslist_cleanup,
- apr_pool_cleanup_null);
+ /* Register a pool pre_cleanup.
+ * This will ensure that reslist_cleanup is run BEFORE
+ * any of the eventual child pools of this pool.
+ * If an child pool was created inside apr_reslist_destructor,
+ * this child pool can safely call apr_pool_destroy inside
+ * apr_reslist_destructor thus safely detaching himself.
+ */
+ apr_pool_pre_cleanup_register(rl->pool, rl, reslist_cleanup,
+ apr_pool_cleanup_null);
*reslist = rl;