From 91371ff934f1b3a9bcc3b5a4555143faefa53a70 Mon Sep 17 00:00:00 2001 From: matteo Date: Tue, 4 Mar 2003 06:00:19 +0000 Subject: Tue Mar 4 07:00:01 CET 2003 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@631 f38db490-d61c-443f-a65b-d21fe96a405b --- res/res_musiconhold.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'res') diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 127047186..0d540aebd 100755 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -531,11 +531,27 @@ static void load_moh_classes(void) } } +void ast_moh_destroy(void) +{ + struct mohclass *moh; + ast_pthread_mutex_lock(&moh_lock); + moh = mohclasses; + while(moh) { + if (moh->pid) { + kill(moh->pid, SIGKILL); + moh->pid = 0; + } + moh = moh->next; + } + ast_pthread_mutex_unlock(&moh_lock); +} + int load_module(void) { int res; load_moh_classes(); res = ast_register_application(app0, moh0_exec, synopsis0, descrip0); + atexit(ast_moh_destroy); if (!res) res = ast_register_application(app1, moh1_exec, synopsis1, descrip1); if (!res) -- cgit v1.2.3