From: Carsten Haitzler (Rasterman) Date: Sun, 24 Jun 2018 02:56:52 +0000 (+0900) Subject: elm focus - fix focus composition prepare to not seg by unsafe list mods X-Git-Tag: upstream/1.21.0~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4827cc857ba34d7aa58e0612f21aabcbbd896030;p=platform%2Fupstream%2Fefl.git elm focus - fix focus composition prepare to not seg by unsafe list mods 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. --- diff --git a/src/lib/elementary/elm_grid.c b/src/lib/elementary/elm_grid.c index bb0036c..47e582a 100644 --- a/src/lib/elementary/elm_grid.c +++ b/src/lib/elementary/elm_grid.c @@ -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); diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c index c044531..6832d45 100644 --- a/src/lib/elementary/elm_table.c +++ b/src/lib/elementary/elm_table.c @@ -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);