From cf7e599fb9042e0c4490cdef7261c3f55ecf5b5a Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Thu, 9 Jun 2011 10:08:58 +0000 Subject: [PATCH] elementary/list - fixed for potential duplicated deletion (this is patched by jae.hwan.kim@samsung.com) since the list calls the unref, it could be deleted multiple times when user delete the list in it's callback function. SVN revision: 60124 --- src/lib/elm_list.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index 6989969..179eb49 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -448,6 +448,20 @@ _elm_list_unwalk(Widget_Data *wd) } static void +_del_pre_hook(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + evas_object_event_callback_del(wd->scr, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints); + evas_object_event_callback_del(wd->box, + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints); +} + +static void _del_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -1313,6 +1327,7 @@ elm_list_add(Evas_Object *parent) elm_widget_sub_object_add(parent, obj); elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL); elm_widget_data_set(obj, wd); + elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_disable_hook_set(obj, _disable_hook); -- 2.7.4