discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=e1063c196b737d32494a45ac29b091eb069d51d2

commit e1063c196b737d32494a45ac29b091eb069d51d2
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Apr 30 14:39:28 2015 -0400

    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
---
 src/bin/e_module.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 24f16a8..baa8ba8 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -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)

-- 


Reply via email to