[svn-commits] mmichelson: branch group/manager2 r104042 - /team/group/manager2/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 22 17:29:08 CST 2008


Author: mmichelson
Date: Fri Feb 22 17:29:07 2008
New Revision: 104042

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104042
Log:
Fix some problematic areas. Had reversed logic in a while loop in the event_spitter.
Also found that my for loop in the unload_module function could potentially leak memory.


Modified:
    team/group/manager2/res/res_manager2.c

Modified: team/group/manager2/res/res_manager2.c
URL: http://svn.digium.com/view/asterisk/team/group/manager2/res/res_manager2.c?view=diff&rev=104042&r1=104041&r2=104042
==============================================================================
--- team/group/manager2/res/res_manager2.c (original)
+++ team/group/manager2/res/res_manager2.c Fri Feb 22 17:29:07 2008
@@ -116,7 +116,7 @@
 		ast_free(event);
 	}
 
-	while (!(event = AST_LIST_REMOVE_HEAD(&info_thread.info_events, list))) {
+	while ((event = AST_LIST_REMOVE_HEAD(&info_thread.info_events, list))) {
 		ast_event_destroy(event->event);
 		ast_free(event);
 	}
@@ -127,8 +127,10 @@
 static int unload_module(void)
 {
 	int i;
-	for (i = 0; manager_sub[i]; i++)
-		ast_event_unsubscribe(manager_sub[i]);
+	for (i = 0; i < AST_EVENT_TOTAL; i++) {
+		if (manager_sub[i])
+			ast_event_unsubscribe(manager_sub[i]);
+	}
 	if (info_thread.thread != AST_PTHREADT_NULL) {
 		info_thread.stop = 1;
 		ast_mutex_lock(&info_thread.lock);




More information about the svn-commits mailing list