summaryrefslogtreecommitdiff
path: root/res/res_timing_pthread.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-02-15 12:41:06 +0000
committerJoshua Colp <jcolp@digium.com>2015-02-15 12:41:06 +0000
commit17f9e0caccda7ec534c16f2c3f2c321b7e389ae6 (patch)
tree9b62fc576ef40f15250506cd8e64346c7e791961 /res/res_timing_pthread.c
parentd1bd8b091b783c8bcefc29d87720016c94e4d5e5 (diff)
res_timing_pthread: Fix leaky pipes.
During some refactoring the way private information for timers was stored was changed. As a result of this the action which normally removed the timer upon closure in res_timing_pthread was also removed causing the timer to remain after it should using up resources. This change ensures that the timer is removed upon closure. ASTERISK-24768 #close Reported by: Matthias Urlichs patches: timer.patch submitted by Matthias Urlichs (license 5508) ........ Merged revisions 431807 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_timing_pthread.c')
-rw-r--r--res/res_timing_pthread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c
index 81efbf8e7..1e76720ec 100644
--- a/res/res_timing_pthread.c
+++ b/res/res_timing_pthread.c
@@ -143,7 +143,7 @@ static void *pthread_timer_open(void)
ast_cond_signal(&timing_thread.cond);
ast_mutex_unlock(&timing_thread.lock);
}
- ao2_link(pthread_timers, timer);
+ ao2_link_flags(pthread_timers, timer, OBJ_NOLOCK);
ao2_unlock(pthread_timers);
return timer;
@@ -153,6 +153,7 @@ static void pthread_timer_close(void *data)
{
struct pthread_timer *timer = data;
+ ao2_unlink(pthread_timers, timer);
ao2_ref(timer, -1);
}