apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1675982 - /apr/apr/trunk/memory/unix/apr_pools.c
Date Fri, 24 Apr 2015 23:04:54 GMT
Author: brane
Date: Fri Apr 24 23:04:54 2015
New Revision: 1675982

URL: http://svn.apache.org/r1675982
Log:
Register the pool debug log cleanup handler after emitting the
global pool creation event.  This ensures that the allocation
event from the cleanup registration written after the creation event.

Modified:
    apr/apr/trunk/memory/unix/apr_pools.c

Modified: apr/apr/trunk/memory/unix/apr_pools.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memory/unix/apr_pools.c?rev=1675982&r1=1675981&r2=1675982&view=diff
==============================================================================
--- apr/apr/trunk/memory/unix/apr_pools.c (original)
+++ apr/apr/trunk/memory/unix/apr_pools.c Fri Apr 24 23:04:54 2015
@@ -1683,13 +1683,6 @@ APR_DECLARE(apr_status_t) apr_pool_initi
     file_stderr = debug_log;
 
     if (file_stderr) {
-        /* Add a cleanup handler that sets the debug log file handle
-         * to NULL, otherwise we'll try to log the global pool
-         * destruction event with predictably disastrous results. */
-        apr_pool_cleanup_register(global_pool, NULL,
-                                  apr_pool_cleanup_file_stderr,
-                                  apr_pool_cleanup_null);
-
         apr_file_printf(file_stderr,
             "POOL DEBUG: [PID"
 #if APR_HAS_THREADS
@@ -1699,6 +1692,13 @@ APR_DECLARE(apr_status_t) apr_pool_initi
             "POOL       \"TAG\" <__FILE__:__LINE__> PARENT     (ALLOCS/TOTAL ALLOCS/CLEARS)\n");
 
         apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0);
+
+        /* Add a cleanup handler that sets the debug log file handle
+         * to NULL, otherwise we'll try to log the global pool
+         * destruction event with predictably disastrous results. */
+        apr_pool_cleanup_register(global_pool, NULL,
+                                  apr_pool_cleanup_file_stderr,
+                                  apr_pool_cleanup_null);
     }
 #endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
 



Mime
View raw message