edje: use EINA_LIST_FOREACH_SAFE when removing item from a list.
authorcedric <cedric>
Thu, 15 Dec 2011 10:02:39 +0000 (10:02 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 15 Dec 2011 10:02:39 +0000 (10:02 +0000)
Bug spotted by Michael Bouchaud.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@66250 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_out.c

index 75104fe..db3cce5 100644 (file)
@@ -1536,10 +1536,10 @@ data_queue_copied_program_lookup(Edje_Part_Collection *pc, int *src, int *dest)
 void
 data_queue_image_lookup(char *name, int *dest, Eina_Bool *set)
 {
-   Eina_List *l;
+  Eina_List *l, *ln;
    Image_Lookup *il;
 
-   EINA_LIST_FOREACH(image_lookups, l, il)
+   EINA_LIST_FOREACH_SAFE(image_lookups, l, ln, il)
      {
         if (il->dest == dest)
           {
@@ -1548,7 +1548,7 @@ data_queue_image_lookup(char *name, int *dest, Eina_Bool *set)
                il->name = mem_strdup(name);
              else
                {
-                  image_lookups = eina_list_remove(image_lookups, il);
+                  image_lookups = eina_list_remove_list(image_lookups, l);
                   free(il);
                }
           }