diff --git a/res/res_smdi.c b/res/res_smdi.c index 3a8a5f4d6b..bd3170ee84 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -1274,7 +1274,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);