]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Aug 2008 19:00:56 +0000 (19:00 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 22 Aug 2008 19:00:56 +0000 (19:00 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9355 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch.c
src/switch_loadable_module.c

index 3c0d842094308c99b32c07f9e44019773ba8390a..823bb82dc2208b48eb646a7c142e518630ff715d 100644 (file)
@@ -206,7 +206,8 @@ typedef enum {
        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;
 
index 9a6f8cfa84d45afc0ba9c8e309d846d9d2b415e8..f5adc2e3af0534b1689298db18a722da9d04cf9e 100644 (file)
@@ -236,6 +236,7 @@ int main(int argc, char *argv[])
                "\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 @@ int main(int argc, char *argv[])
                        known_opt++;
                }
 
+               if (argv[x] && !strcmp(argv[x], "-vg")) {
+                       flags |= SCF_VG;
+                       known_opt++;
+               }
+
                if (argv[x] && !strcmp(argv[x], "-stop")) {
                        die++;
                        known_opt++;
index aba41f40e7c217dcfd35f159ce3909494d6e8c4d..cd0bd049330a7c2f7f0d9d1dc579fae2c4517a20 100644 (file)
@@ -1109,8 +1109,9 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
 
 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 @@ static void do_shutdown(switch_loadable_module_t *module, switch_bool_t shutdown
                }
        }
 
-       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);