eo: Fix composite objects destruction
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 28 Jun 2016 10:29:31 +0000 (19:29 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 28 Jun 2016 10:29:31 +0000 (19:29 +0900)
This walks the list and removes objects from it. Not
using EINA_LIST_FREE as the actual list_remove is done
inside eo_composite_detach.

src/lib/eo/eo_base_class.c

index fe12067..82ab7d6 100644 (file)
@@ -1439,9 +1439,9 @@ _eo_base_destructor(Eo *obj, Eo_Base_Data *pd)
    /* If we are a composite object, detach children */
      {
         EO_OBJ_POINTER_RETURN(obj, obj_data);
-        Eina_List *itr;
+        Eina_List *itr, *next;
         Eo *emb_obj_id;
-        EINA_LIST_FOREACH(obj_data->composite_objects, itr, emb_obj_id)
+        EINA_LIST_FOREACH_SAFE(obj_data->composite_objects, itr, next, emb_obj_id)
           {
              eo_composite_detach(obj, emb_obj_id);
           }