summaryrefslogtreecommitdiff
path: root/src/lib/elm_genlist.c
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-14 22:04:26 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-14 22:04:26 +0900
commitb45220bf2bad42f56db4ec329c7c1bd9b4c0ba30 (patch)
tree95ea7189652f33c1c4d356ed8da156df711c43c0 /src/lib/elm_genlist.c
parent78f1bb593fea2323b6998c1b7bfc9b2ed5c72de2 (diff)
genlist: fix a crash of genlist group tree example.
don't corrupt list pointer. we can clear items more simply. Thanks ya-kov for reporting.
Diffstat (limited to 'src/lib/elm_genlist.c')
-rw-r--r--src/lib/elm_genlist.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 0448de108..58f3b90a6 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -5585,9 +5585,8 @@ _elm_genlist_eo_base_constructor(Eo *obj, Elm_Genlist_Data *sd)
5585static void 5585static void
5586_internal_elm_genlist_clear(Evas_Object *obj) 5586_internal_elm_genlist_clear(Evas_Object *obj)
5587{ 5587{
5588 Eina_Inlist *next, *l;
5589
5590 ELM_GENLIST_DATA_GET(obj, sd); 5588 ELM_GENLIST_DATA_GET(obj, sd);
5589 Elm_Gen_Item *it;
5591 5590
5592 _elm_genlist_item_unfocused(sd->focused_item); 5591 _elm_genlist_item_unfocused(sd->focused_item);
5593 if (sd->mode_item) sd->mode_item = NULL; 5592 if (sd->mode_item) sd->mode_item = NULL;
@@ -5597,11 +5596,9 @@ _internal_elm_genlist_clear(Evas_Object *obj)
5597 evas_event_freeze(evas_object_evas_get(sd->obj)); 5596 evas_event_freeze(evas_object_evas_get(sd->obj));
5598 // Do not use EINA_INLIST_FOREACH or EINA_INLIST_FOREACH_SAFE 5597 // Do not use EINA_INLIST_FOREACH or EINA_INLIST_FOREACH_SAFE
5599 // because sd->items can be modified inside elm_widget_item_del() 5598 // because sd->items can be modified inside elm_widget_item_del()
5600 for (l = sd->items, next = l ? l->next : NULL; 5599 while (sd->items)
5601 l;
5602 l = next, next = next ? next->next : NULL)
5603 { 5600 {
5604 Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(l); 5601 it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
5605 eo_do(EO_OBJ(it), elm_wdg_item_del()); 5602 eo_do(EO_OBJ(it), elm_wdg_item_del());
5606 } 5603 }
5607 sd->pan_changed = EINA_TRUE; 5604 sd->pan_changed = EINA_TRUE;