summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-15 16:53:06 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-15 16:53:06 +0900
commitc4703dea54eb886ab26061055d5183d13e6a8a12 (patch)
treec4ba46721d41a7905f42bc4b1ec2507411f66273
parent8ae155955e0e2774613373ae42259e1a4cac135c (diff)
downloadelementary-c4703dea54eb886ab26061055d5183d13e6a8a12.tar.gz
genlist: revert partial code.
this clearing items are still valid.
-rw-r--r--src/lib/elm_genlist.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 6caa05ef7..1168f3ec0 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -5599,7 +5599,6 @@ static void
_internal_elm_genlist_clear(Evas_Object *obj)
{
ELM_GENLIST_DATA_GET(obj, sd);
- Eina_Inlist *l;
Elm_Gen_Item *it;
_elm_genlist_item_unfocused(sd->focused_item);
@@ -5609,9 +5608,13 @@ _internal_elm_genlist_clear(Evas_Object *obj)
evas_event_freeze(evas_object_evas_get(sd->obj));
- EINA_INLIST_FOREACH_SAFE(sd->items, l, it)
- eo_do(EO_OBJ(it), elm_wdg_item_del());
-
+ // Do not use EINA_INLIST_FOREACH or EINA_INLIST_FOREACH_SAFE
+ // because sd->items can be modified inside elm_widget_item_del()
+ while (sd->items)
+ {
+ it = EINA_INLIST_CONTAINER_GET(sd->items->last, Elm_Gen_Item);
+ eo_do(EO_OBJ(it), elm_wdg_item_del());
+ }
sd->pan_changed = EINA_TRUE;
if (!sd->queue)
{