summaryrefslogtreecommitdiff
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-02-19 02:01:34 +0000
committerCorey Farrell <git@cfware.com>2015-02-19 02:01:34 +0000
commiteb9448a1ae18bf16074346bdaae5e0d29d3bcd38 (patch)
tree8edb32f30e14e1450ba46c23aa67f06baa299dea /channels/chan_iax2.c
parent6d3fcfc3c2f49b3909b7ae0ebb74d99e2fedbb65 (diff)
Create work around for scheduler leaks during shutdown.
* Added ast_sched_clean_by_callback for cleanup of scheduled events that have not yet fired. * Run all pending peercnt_remove_cb and replace_callno events in chan_iax2. Cleanup of replace_callno events is only run 11, since it no longer releases any references or allocations in 13+. ASTERISK-24451 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4425/ ........ Merged revisions 431916 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index b0c426fe1..dbc1bb05c 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -14692,7 +14692,6 @@ static int __unload_module(void)
ao2_ref(users, -1);
ao2_ref(iax_peercallno_pvts, -1);
ao2_ref(iax_transfercallno_pvts, -1);
- ao2_ref(peercnts, -1);
ao2_ref(callno_limits, -1);
ao2_ref(calltoken_ignores, -1);
if (timer) {
@@ -14700,8 +14699,11 @@ static int __unload_module(void)
timer = NULL;
}
transmit_processor = ast_taskprocessor_unreference(transmit_processor);
+
+ ast_sched_clean_by_callback(sched, peercnt_remove_cb, peercnt_remove_cb);
ast_sched_context_destroy(sched);
sched = NULL;
+ ao2_ref(peercnts, -1);
con = ast_context_find(regcontext);
if (con)