forked from enlightenment/enlightenment
prune module config list when loading a module
it's somehow possible to get multiple instances of a module in the config. since I don't know whether this is a current or past problem, prune the list on every module load to remove subsequent instances of the module fix T2181
This commit is contained in:
parent
1f9ec6a710
commit
e1063c196b
|
@ -297,7 +297,7 @@ e_module_new(const char *name)
|
|||
char body[4096], title[1024];
|
||||
const char *modpath = NULL;
|
||||
char *s;
|
||||
Eina_List *l;
|
||||
Eina_List *l, *ll;
|
||||
E_Config_Module *em;
|
||||
int in_list = 0;
|
||||
|
||||
|
@ -426,13 +426,20 @@ init_done:
|
|||
}
|
||||
}
|
||||
}
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
EINA_LIST_FOREACH_SAFE(e_config->modules, l, ll, em)
|
||||
{
|
||||
if (!em) continue;
|
||||
if (em->name == m->name)
|
||||
{
|
||||
in_list = 1;
|
||||
break;
|
||||
if (in_list)
|
||||
{
|
||||
/* duplicate module config */
|
||||
e_config->modules = eina_list_remove_list(e_config->modules, l);
|
||||
eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
}
|
||||
else
|
||||
in_list = 1;
|
||||
}
|
||||
}
|
||||
if (!in_list)
|
||||
|
|
Loading…
Reference in New Issue