apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c
Date Thu, 17 Jul 2008 05:45:57 GMT
Author: mturk
Date: Wed Jul 16 22:45:57 2008
New Revision: 677505

URL: http://svn.apache.org/viewvc?rev=677505&view=rev
Log:
Use apr_pool_pre_cleanup_register for reslist cleanup

Modified:
    apr/apr-util/trunk/misc/apr_reslist.c

Modified: apr/apr-util/trunk/misc/apr_reslist.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/misc/apr_reslist.c?rev=677505&r1=677504&r2=677505&view=diff
==============================================================================
--- apr/apr-util/trunk/misc/apr_reslist.c (original)
+++ apr/apr-util/trunk/misc/apr_reslist.c Wed Jul 16 22:45:57 2008
@@ -277,8 +277,15 @@
         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;
 



Mime
View raw message