From: Joshua Colp Date: Wed, 27 Feb 2008 15:52:02 +0000 (+0000) Subject: Only stop the MWI monitor thread if it was actually started. X-Git-Tag: 1.4.19~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb7aa0e4bc02d5e8f1cfd0dc2a8d3ff32927ecc0;p=thirdparty%2Fasterisk.git Only stop the MWI monitor thread if it was actually started. (closes issue #12086) Reported by: francesco_r git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104536 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_smdi.c b/res/res_smdi.c index 87a4dd49d2..9315cf9732 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -1281,7 +1281,9 @@ static int unload_module(void) ast_cond_signal(&mwi_monitor.cond); ast_mutex_unlock(&mwi_monitor.lock); - pthread_join(mwi_monitor.thread, NULL); + if (mwi_monitor.thread != AST_PTHREADT_NULL) { + pthread_join(mwi_monitor.thread, NULL); + } ast_custom_function_unregister(&smdi_msg_retrieve_function); ast_custom_function_unregister(&smdi_msg_function);