[asterisk-commits] russell: trunk r109910 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 19 10:45:49 CDT 2008


Author: russell
Date: Wed Mar 19 10:45:49 2008
New Revision: 109910

URL: http://svn.digium.com/view/asterisk?view=rev&rev=109910
Log:
Fix some more breakage that I introduced when changing extension state callbacks to the list macros.

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=109910&r1=109909&r2=109910
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Mar 19 10:45:49 2008
@@ -5433,7 +5433,7 @@
 	struct ast_hint *hint;
 	struct ast_exten *exten;
 	int length;
-	struct ast_state_cb *thiscb, *prevcb;
+	struct ast_state_cb *thiscb;
 	struct ast_hashtab_iter *iter;
 	
 	/* it is very important that this function hold the hint list lock _and_ the conlock
@@ -5451,7 +5451,7 @@
 	begintime = ast_tvnow();
 	ast_rdlock_contexts();
 	iter = ast_hashtab_start_traversal(contexts_table);
-	while ((tmp=ast_hashtab_next(iter))) {
+	while ((tmp = ast_hashtab_next(iter))) {
 		context_merge(extcontexts, exttable, tmp, registrar);
 	}
 	ast_hashtab_end_traversal(iter);
@@ -5506,11 +5506,11 @@
 		if (!exten || !hint) {
 			/* this hint has been removed, notify the watchers */
 			while ((thiscb = AST_LIST_REMOVE_HEAD(&this->callbacks, entry))) {
-				prevcb->callback(this->context, this->exten, AST_EXTENSION_REMOVED, prevcb->data);
-				ast_free(prevcb);
+				thiscb->callback(this->context, this->exten, AST_EXTENSION_REMOVED, thiscb->data);
+				ast_free(thiscb);
 			}
 		} else {
-			AST_LIST_INSERT_TAIL(&this->callbacks, thiscb, entry);
+			AST_LIST_APPEND_LIST(&hint->callbacks, &this->callbacks, entry);
 			hint->laststate = this->laststate;
 		}
 		ast_free(this);




More information about the asterisk-commits mailing list