From 49333d5e39a7840d320e007a140efb438a261578 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Wed, 29 Aug 2012 23:38:58 +0000 Subject: [PATCH] elm list: Do not process _size_hints_changed_cb when list is going to be deleted. This fixes list self deletion bug when evas_object_del(list) is called inside item selected callback. SVN revision: 75832 --- src/lib/elm_list.c | 4 ++++ src/lib/elm_widget_list.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index d5f6e4b..a67a0ec 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -691,6 +691,9 @@ _size_hints_changed_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { + ELM_LIST_DATA_GET(data, sd); + if (sd->delete_me) return; + _items_fix(data); elm_layout_sizing_eval(data); } @@ -1548,6 +1551,7 @@ _elm_list_smart_del(Evas_Object *obj) if (sd->walking) ERR("ERROR: list deleted while walking.\n"); + sd->delete_me = EINA_TRUE; EINA_LIST_FOREACH (sd->items, l, it) { if (it->icon) diff --git a/src/lib/elm_widget_list.h b/src/lib/elm_widget_list.h index ea85751..8bd51c5 100644 --- a/src/lib/elm_widget_list.h +++ b/src/lib/elm_widget_list.h @@ -153,6 +153,7 @@ struct _Elm_List_Smart_Data Eina_Bool on_hold : 1; Eina_Bool multi : 1; Eina_Bool swipe : 1; + Eina_Bool delete_me : 1; }; typedef struct _Elm_List_Item Elm_List_Item; -- 2.7.4