[Freeswitch-svn] [commit] r10994 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Mon Dec 29 14:41:04 PST 2008


Author: anthm
Date: Mon Dec 29 17:41:03 2008
New Revision: 10994

Log:
fix FSCORE-261

Modified:
   freeswitch/trunk/src/switch_core.c

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon Dec 29 17:41:03 2008
@@ -168,7 +168,7 @@
 
 SWITCH_DECLARE(void) switch_core_remove_state_handler(const switch_state_handler_table_t *state_handler)
 {
-	int index, total = 0;
+	int index, tmp_index = 0;
 	const switch_state_handler_table_t *tmp[SWITCH_MAX_STATE_HANDLERS+1] = { 0 };
 	
 	switch_mutex_lock(runtime.global_mutex);
@@ -179,13 +179,12 @@
 		if (cur == state_handler) {
 			continue;
 		}
-		tmp[index] = runtime.state_handlers[index];
-		total++;
+		tmp[tmp_index++] = cur;
 	}
 
 	runtime.state_handler_index = 0;
 
-	for (index = 0; index < total; index++) {
+	for (index = 0; index < tmp_index; index++) {
 		runtime.state_handlers[runtime.state_handler_index++] = tmp[index];
 	}
 	switch_mutex_unlock(runtime.global_mutex);



More information about the Freeswitch-svn mailing list