2
0
Fork 0

[core] Don't increase refcount for module when specified multiple times in config

personal/stbuehler/wip
Thomas Porzelt 2009-10-04 16:58:31 +02:00
parent 24ef64338f
commit eff81a92e9
1 changed files with 8 additions and 1 deletions

View File

@ -545,7 +545,9 @@ static gboolean core_workers(liServer *srv, liPlugin* p, liValue *val) {
}
static gboolean core_module_load(liServer *srv, liPlugin* p, liValue *val) {
GString *name;
liValue *mods = li_value_new_list();
UNUSED(p);
if (!g_module_supported()) {
@ -577,7 +579,12 @@ static gboolean core_module_load(liServer *srv, liPlugin* p, liValue *val) {
/* parameter types ok, load modules */
for (guint i = 0; i < mods->data.list->len; i++) {
GString *name = g_array_index(mods->data.list, liValue*, i)->data.string;
name = g_array_index(mods->data.list, liValue*, i)->data.string;
if (li_module_lookup(srv->modules, name->str)) {
DEBUG(srv, "module_load: module '%s' already loaded", name->str);
continue;
}
if (!li_module_load(srv->modules, name->str)) {
ERROR(srv, "could not load module '%s': %s", name->str, g_module_error());
li_value_free(mods);