From 5b07498ba181a934e100e35c56aaf51ef81b5a1b Mon Sep 17 00:00:00 2001 From: zmike Date: Sun, 23 Mar 2014 03:10:15 -0400 Subject: [PATCH] genlist needs to iterate exactly once over a fixed list when deselcting all items the selected items list can be modified during deselect from the smart callback, which can cause an infinite loop here @fix --- legacy/elementary/src/lib/elm_genlist.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 776830e8f7..888c904ce3 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -2377,10 +2377,14 @@ _item_multi_select_down(Elm_Genlist_Smart_Data *sd) static Eina_Bool _all_items_deselect(Elm_Genlist_Smart_Data *sd) { + Eina_List *l; + Elm_Object_Item *it; + if (!sd->selected) return EINA_FALSE; - while (sd->selected) - elm_genlist_item_selected_set(sd->selected->data, EINA_FALSE); + l = eina_list_clone(sd->selected); + EINA_LIST_FREE(l, it) + elm_genlist_item_selected_set(it, EINA_FALSE); return EINA_TRUE; }