提交 3474b141 authored 作者: Michael Jerris's avatar Michael Jerris

fix shutdown race destroying memory pools.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7943 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 dce0e8db
...@@ -1049,6 +1049,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void) ...@@ -1049,6 +1049,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "End existing sessions\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "End existing sessions\n");
switch_core_session_hupall(SWITCH_CAUSE_SYSTEM_SHUTDOWN); switch_core_session_hupall(SWITCH_CAUSE_SYSTEM_SHUTDOWN);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Clean up modules.\n");
switch_core_memory_stop();
switch_loadable_module_shutdown(); switch_loadable_module_shutdown();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Closing Event Engine.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Closing Event Engine.\n");
...@@ -1061,7 +1062,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void) ...@@ -1061,7 +1062,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_rtp_shutdown(); switch_rtp_shutdown();
switch_xml_destroy(); switch_xml_destroy();
switch_core_memory_stop();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
switch_log_shutdown(); switch_log_shutdown();
......
...@@ -312,16 +312,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor ...@@ -312,16 +312,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_new_memory_pool(switch_memor
SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_memory_pool_t **pool, const char *file, const char *func, int line) SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_memory_pool_t **pool, const char *file, const char *func, int line)
{ {
//char tmp[128] = "";
switch_assert(pool != NULL); switch_assert(pool != NULL);
#ifdef DEBUG_ALLOC2 #ifdef DEBUG_ALLOC2
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "Free Pool\n"); switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "Free Pool\n");
#endif #endif
if (switch_queue_push(memory_manager.pool_queue, *pool) != SWITCH_STATUS_SUCCESS) { if ((memory_manager.pool_thread_running != 1) || (switch_queue_push(memory_manager.pool_queue, *pool) != SWITCH_STATUS_SUCCESS)) {
apr_pool_destroy(*pool); apr_pool_destroy(*pool);
} }
*pool = NULL; *pool = NULL;
......
...@@ -421,7 +421,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown) ...@@ -421,7 +421,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown)
switch_yield(10000); switch_yield(10000);
} }
} }
switch_core_destroy_memory_pool(&module_pool);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论