elm focus - fix focus composition prepare to not seg by unsafe list mods
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 24 Jun 2018 02:56:52 +0000 (11:56 +0900)
committerMyoungwoon Roy, Kim <myoungwoon.kim@samsung.com>
Mon, 25 Jun 2018 08:37:40 +0000 (17:37 +0900)
efl_ui_focus_composition_prepare() methods in 2 widgets were modifying
the list (removing items) as they walked, using unsafe walking macros.
fix - use the safe variants.

src/lib/elementary/elm_grid.c
src/lib/elementary/elm_table.c

index bb0036c..47e582a 100644 (file)
@@ -100,13 +100,13 @@ _elm_grid_efl_ui_widget_focus_direction(Eo *obj, void *_pd EINA_UNUSED, const Ev
 static void
 _elm_grid_efl_ui_focus_composition_prepare(Eo *obj, void *pd EINA_UNUSED)
 {
-   Eina_List *l;
+   Eina_List *l, *ll;
    Efl_Ui_Widget *elem;
 
    Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
    Eina_List *order = evas_object_grid_children_get(wpd->resize_obj);
 
-   EINA_LIST_FOREACH(order, l, elem)
+   EINA_LIST_FOREACH_SAFE(order, l, ll, elem)
      {
         if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
           order = eina_list_remove(order, elem);
index c044531..6832d45 100644 (file)
@@ -102,13 +102,13 @@ _elm_table_efl_ui_widget_focus_direction(Eo *obj, void *_pd EINA_UNUSED, const E
 static void
 _elm_table_efl_ui_focus_composition_prepare(Eo *obj, void *pd EINA_UNUSED)
 {
-   Eina_List *l;
+   Eina_List *l, *ll;
    Efl_Ui_Widget *elem;
 
    Elm_Widget_Smart_Data *wpd = efl_data_scope_get(obj, EFL_UI_WIDGET_CLASS);
    Eina_List *order = evas_object_table_children_get(wpd->resize_obj);
 
-   EINA_LIST_FOREACH(order, l, elem)
+   EINA_LIST_FOREACH_SAFE(order, l, ll, elem)
      {
         if (!efl_isa(elem, EFL_UI_WIDGET_CLASS))
           order = eina_list_remove(order, elem);