[Freeswitch-svn] [commit] r9355 - in freeswitch/trunk/src: . include

Freeswitch SVN anthm at freeswitch.org
Fri Aug 22 15:00:56 EDT 2008


Author: anthm
Date: Fri Aug 22 15:00:56 2008
New Revision: 9355

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch.c
   freeswitch/trunk/src/switch_loadable_module.c

Log:
update

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Fri Aug 22 15:00:56 2008
@@ -206,7 +206,8 @@
 	SCF_USE_SQL = (1 << 0),
 	SCF_NO_NEW_SESSIONS = (1 << 1),
 	SCF_SHUTTING_DOWN = (1 << 2),
-	SCF_CRASH_PROT = (1 << 3)
+	SCF_CRASH_PROT = (1 << 3),
+	SCF_VG = (1 << 4)
 } switch_core_flag_enum_t;
 typedef uint32_t switch_core_flag_t;
 

Modified: freeswitch/trunk/src/switch.c
==============================================================================
--- freeswitch/trunk/src/switch.c	(original)
+++ freeswitch/trunk/src/switch.c	Fri Aug 22 15:00:56 2008
@@ -236,6 +236,7 @@
 		"\t-core            -- dump cores\n"
 #endif
 		"\t-hp              -- enable high priority settings\n"
+		"\t-vg              -- run under valgrind\n"
 		"\t-nosql           -- disable internal sql scoreboard\n"
 		"\t-stop            -- stop freeswitch\n"
 		"\t-nc              -- do not output to a console and background\n"
@@ -387,6 +388,11 @@
 			known_opt++;
 		}
 
+		if (argv[x] && !strcmp(argv[x], "-vg")) {
+			flags |= SCF_VG;
+			known_opt++;
+		}
+
 		if (argv[x] && !strcmp(argv[x], "-stop")) {
 			die++;
 			known_opt++;

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Fri Aug 22 15:00:56 2008
@@ -1109,8 +1109,9 @@
 
 static void do_shutdown(switch_loadable_module_t *module, switch_bool_t shutdown, switch_bool_t unload)
 {
+	int32_t flags = switch_core_flags();
 	switch_assert(module != NULL);
-
+	
 	if (shutdown) {
 		switch_loadable_module_unprocess(module);
 		if (module->switch_module_shutdown) {
@@ -1121,7 +1122,7 @@
 		}
 	}
 
-	if (unload && module->status != SWITCH_STATUS_NOUNLOAD) {
+	if (unload && module->status != SWITCH_STATUS_NOUNLOAD 	&& !(flags & SCF_VG)) {
 		switch_memory_pool_t *pool;
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s unloaded.\n", module->module_interface->module_name);
 		switch_dso_unload(module->lib);



More information about the Freeswitch-svn mailing list