[asterisk-commits] russell: branch group/chan_unistim r88157 - /team/group/chan_unistim/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 1 15:29:44 CDT 2007


Author: russell
Date: Thu Nov  1 15:29:43 2007
New Revision: 88157

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88157
Log:
apply junky's patch to fix a crash on reload when no config is present

Modified:
    team/group/chan_unistim/channels/chan_unistim.c

Modified: team/group/chan_unistim/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/team/group/chan_unistim/channels/chan_unistim.c?view=diff&rev=88157&r1=88156&r2=88157
==============================================================================
--- team/group/chan_unistim/channels/chan_unistim.c (original)
+++ team/group/chan_unistim/channels/chan_unistim.c Thu Nov  1 15:29:43 2007
@@ -5489,14 +5489,17 @@
                         unload_module();
                         free(buff);
                         return AST_MODULE_LOAD_FAILURE;
-                }
+                } 
 
                 ast_rtp_proto_register(&unistim_rtp);
                 ast_cli_register_multiple(unistim_cli,sizeof(unistim_cli) / sizeof(unistim_cli[0]));
 
                 restart_monitor();
-        }
-        return 0;
+        	return 0;
+        } else {
+		ast_log(LOG_WARNING, "no conf file\n");
+		return AST_MODULE_LOAD_DECLINE;	
+	}
 }
 
 static int __unload_module(void)
@@ -5511,9 +5514,10 @@
         /* Hangup all device with active sessions, delete lines then devices ?*/
 
         if (!ast_mutex_lock(&monlock)) {
-                if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) {
+		if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP) && (monitor_thread != AST_PTHREADT_NULL)) {
                         pthread_cancel(monitor_thread);
                         pthread_kill(monitor_thread, SIGURG);
+			pthread_join(monitor_thread, NULL);
                 }
                 monitor_thread = AST_PTHREADT_STOP;
                 ast_mutex_unlock(&monlock);




More information about the asterisk-commits mailing list