From: Russell Bryant Date: Wed, 19 Mar 2008 15:45:49 +0000 (+0000) Subject: Fix some more breakage that I introduced when changing extension state callbacks... X-Git-Tag: 1.6.0-beta7~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c6486782f7dc006ffb8c848914087c1be3b3407;p=thirdparty%2Fasterisk.git Fix some more breakage that I introduced when changing extension state callbacks to the list macros. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109910 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 9cffae8ef6..650b0d9d99 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -5433,7 +5433,7 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_ 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 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_ 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 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_ 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);