summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Jung <rjung@apache.org>2019-07-17 11:46:14 +0000
committerRainer Jung <rjung@apache.org>2019-07-17 11:46:14 +0000
commita0c0a1d3d841248b34e7204d8049440371508d71 (patch)
tree12ee7eb1c9ec8288ef87c89c8fdd421508ac39cd
parent24b218016e875e2dc0c87ce7b7341f00e37e4753 (diff)
downloadapr-a0c0a1d3d841248b34e7204d8049440371508d71.tar.gz
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. Backport of r1675982 from trunk resp. r1863204 from 1.7.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1863213 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--memory/unix/apr_pools.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index eb173c88e..a59d9dac2 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -1712,13 +1712,6 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void)
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
@@ -1728,6 +1721,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void)
"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) */