aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-14 17:17:05 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-07-14 17:17:05 +0000
commitc4c0821cddee2756af44c091339af2630e3b9dd1 (patch)
tree3ef5fd08664045d2be2376aef061b98130f67662 /pbx.c
parent592421c2955f5496d1333567d656289b1d5cd5d3 (diff)
pbx.c didn't get updated
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1188 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/pbx.c b/pbx.c
index ce547edd5..903476241 100755
--- a/pbx.c
+++ b/pbx.c
@@ -2741,14 +2741,22 @@ struct ast_context *ast_context_create(struct ast_context **extcontexts, char *n
void __ast_context_destroy(struct ast_context *con, char *registrar, int lock);
-void ast_merge_contexts_and_delete(struct ast_context **extcontexts) {
+void ast_merge_contexts_and_delete(struct ast_context **extcontexts, char *registrar) {
struct ast_context *tmp, *lasttmp = NULL;
tmp = *extcontexts;
ast_pthread_mutex_lock(&conlock);
- while (tmp) {
- __ast_context_destroy(tmp,tmp->registrar,0);
- lasttmp = tmp;
- tmp = tmp->next;
+ if (registrar) {
+ __ast_context_destroy(NULL,registrar,0);
+ while (tmp) {
+ lasttmp = tmp;
+ tmp = tmp->next;
+ }
+ } else {
+ while (tmp) {
+ __ast_context_destroy(tmp,tmp->registrar,0);
+ lasttmp = tmp;
+ tmp = tmp->next;
+ }
}
if (lasttmp) {
lasttmp->next = contexts;