mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 08:44:14 +00:00
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
This commit is contained in:
10
main/pbx.c
10
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_hint *hint;
|
||||||
struct ast_exten *exten;
|
struct ast_exten *exten;
|
||||||
int length;
|
int length;
|
||||||
struct ast_state_cb *thiscb, *prevcb;
|
struct ast_state_cb *thiscb;
|
||||||
struct ast_hashtab_iter *iter;
|
struct ast_hashtab_iter *iter;
|
||||||
|
|
||||||
/* it is very important that this function hold the hint list lock _and_ the conlock
|
/* 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();
|
begintime = ast_tvnow();
|
||||||
ast_rdlock_contexts();
|
ast_rdlock_contexts();
|
||||||
iter = ast_hashtab_start_traversal(contexts_table);
|
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);
|
context_merge(extcontexts, exttable, tmp, registrar);
|
||||||
}
|
}
|
||||||
ast_hashtab_end_traversal(iter);
|
ast_hashtab_end_traversal(iter);
|
||||||
@@ -5506,11 +5506,11 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, struct ast_
|
|||||||
if (!exten || !hint) {
|
if (!exten || !hint) {
|
||||||
/* this hint has been removed, notify the watchers */
|
/* this hint has been removed, notify the watchers */
|
||||||
while ((thiscb = AST_LIST_REMOVE_HEAD(&this->callbacks, entry))) {
|
while ((thiscb = AST_LIST_REMOVE_HEAD(&this->callbacks, entry))) {
|
||||||
prevcb->callback(this->context, this->exten, AST_EXTENSION_REMOVED, prevcb->data);
|
thiscb->callback(this->context, this->exten, AST_EXTENSION_REMOVED, thiscb->data);
|
||||||
ast_free(prevcb);
|
ast_free(thiscb);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AST_LIST_INSERT_TAIL(&this->callbacks, thiscb, entry);
|
AST_LIST_APPEND_LIST(&hint->callbacks, &this->callbacks, entry);
|
||||||
hint->laststate = this->laststate;
|
hint->laststate = this->laststate;
|
||||||
}
|
}
|
||||||
ast_free(this);
|
ast_free(this);
|
||||||
|
Reference in New Issue
Block a user