Skip to content

Commit b8ec427

Browse files
committed
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
1 parent 243e33e commit b8ec427

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

memory/unix/apr_pools.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,13 +1712,6 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void)
17121712
file_stderr = debug_log;
17131713

17141714
if (file_stderr) {
1715-
/* Add a cleanup handler that sets the debug log file handle
1716-
* to NULL, otherwise we'll try to log the global pool
1717-
* destruction event with predictably disastrous results. */
1718-
apr_pool_cleanup_register(global_pool, NULL,
1719-
apr_pool_cleanup_file_stderr,
1720-
apr_pool_cleanup_null);
1721-
17221715
apr_file_printf(file_stderr,
17231716
"POOL DEBUG: [PID"
17241717
#if APR_HAS_THREADS
@@ -1728,6 +1721,13 @@ APR_DECLARE(apr_status_t) apr_pool_initialize(void)
17281721
"POOL \"TAG\" <__FILE__:__LINE__> PARENT (ALLOCS/TOTAL ALLOCS/CLEARS)\n");
17291722

17301723
apr_pool_log_event(global_pool, "GLOBAL", __FILE__ ":apr_pool_initialize", 0);
1724+
1725+
/* Add a cleanup handler that sets the debug log file handle
1726+
* to NULL, otherwise we'll try to log the global pool
1727+
* destruction event with predictably disastrous results. */
1728+
apr_pool_cleanup_register(global_pool, NULL,
1729+
apr_pool_cleanup_file_stderr,
1730+
apr_pool_cleanup_null);
17311731
}
17321732
#endif /* (APR_POOL_DEBUG & APR_POOL_DEBUG_VERBOSE_ALL) */
17331733

0 commit comments

Comments
 (0)