]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
prevent double load of modules
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Dec 2006 16:08:56 +0000 (16:08 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 1 Dec 2006 16:08:56 +0000 (16:08 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3506 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_loadable_module.c

index 7d3326bb5383de7c4d09462829843483845cd565..a60c2169caf087d9dffa901d487b3e37835339ce 100644 (file)
@@ -380,7 +380,12 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
                        snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
                }
        }
-       
+
+    if (switch_core_hash_find(loadable_modules.module_hash, file)) {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Module %s Already Loaded!\n", file);
+        return SWITCH_STATUS_FALSE;
+    }
+
        if ((status = switch_loadable_module_load_file(path, &new_module) == SWITCH_STATUS_SUCCESS)) {
                return switch_loadable_module_process((char *) file, new_module);
        } else {