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
This commit is contained in:
zmike 2014-03-23 03:10:15 -04:00
parent 0008452aba
commit 5b07498ba1
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}