fix shutdown race destroying memory pools.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7943 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2008-03-20 02:05:34 +00:00
parent dce0e8db8c
commit 3474b1412a
3 changed files with 2 additions and 6 deletions

View File

@@ -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)
{
//char tmp[128] = "";
switch_assert(pool != NULL);
#ifdef DEBUG_ALLOC2
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "Free Pool\n");
#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);
}
*pool = NULL;