summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c5
-rw-r--r--channels/chan_sip.c9
-rw-r--r--channels/chan_skinny.c8
3 files changed, 5 insertions, 17 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index dc30d9fe7..6e8e9e4f7 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -14636,7 +14636,6 @@ static void cleanup_thread_list(void *head)
static int __unload_module(void)
{
- struct ast_context *con;
int x;
network_change_stasis_unsubscribe();
@@ -14713,9 +14712,7 @@ static int __unload_module(void)
sched = NULL;
ao2_ref(peercnts, -1);
- con = ast_context_find(regcontext);
- if (con)
- ast_context_destroy(con, "IAX2");
+ ast_context_destroy_by_name(regcontext, "IAX2");
ast_unload_realtime("iaxpeers");
ao2_ref(iax2_tech.capabilities, -1);
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b1fbd6e9b..5be0200ed 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -19750,8 +19750,7 @@ static void cleanup_stale_contexts(char *new, char *old)
}
}
- if (stalecontext)
- ast_context_destroy(ast_context_find(stalecontext), "SIP");
+ ast_context_destroy_by_name(stalecontext, "SIP");
}
}
@@ -34540,7 +34539,6 @@ static int unload_module(void)
{
struct sip_pvt *p;
struct sip_threadinfo *th;
- struct ast_context *con;
struct ao2_iterator i;
int wait_count;
@@ -34718,10 +34716,7 @@ static int unload_module(void)
close(sipsock);
io_context_destroy(io);
ast_sched_context_destroy(sched);
- con = ast_context_find(used_context);
- if (con) {
- ast_context_destroy(con, "SIP");
- }
+ ast_context_destroy_by_name(used_context, "SIP");
ast_unload_realtime("sipregs");
ast_unload_realtime("sippeers");
ast_cc_monitor_unregister(&sip_cc_monitor_callbacks);
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index be9f9b67e..3d2d2e8d1 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -2198,8 +2198,7 @@ static void cleanup_stale_contexts(char *new, char *old)
}
}
- if (stalecontext)
- ast_context_destroy(ast_context_find(stalecontext), "Skinny");
+ ast_context_destroy_by_name(stalecontext, "Skinny");
}
}
@@ -8710,7 +8709,6 @@ static int unload_module(void)
struct skinny_device *d;
struct skinny_line *l;
struct skinny_subchannel *sub;
- struct ast_context *con;
pthread_t tempthread;
ast_rtp_glue_unregister(&skinny_rtp_glue);
@@ -8771,9 +8769,7 @@ static int unload_module(void)
ast_sched_context_destroy(sched);
}
- con = ast_context_find(used_context);
- if (con)
- ast_context_destroy(con, "Skinny");
+ ast_context_destroy_by_name(used_context, "Skinny");
ao2_ref(default_cap, -1);
return 0;