From 155420a73be3731544ae3531fbf5d7226adbf562 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 18 Aug 2006 20:03:34 +0000 Subject: [PATCH] tweaks part 2 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2329 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 6f9a1be7a9..ce844d1cc5 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -291,7 +291,7 @@ SWITCH_DECLARE(void) switch_core_session_hupall(void) } switch_mutex_unlock(runtime.session_table_mutex); - while(runtime.session_count) { + while(runtime.session_count > 0) { switch_yield(10000); } } @@ -2492,7 +2492,9 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session_t **session pool = NULL; switch_mutex_lock(runtime.session_table_mutex); - runtime.session_count--; + if (runtime.session_count) { + runtime.session_count--; + } switch_mutex_unlock(runtime.session_table_mutex); }