[elm_list] self delete bug fix
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 18 May 2011 10:29:43 +0000 (19:29 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Mon, 23 May 2011 04:42:48 +0000 (13:42 +0900)
add comment

Change-Id: I9c187c867caf0d3a1eabbc77c3176e81b0e94501

src/lib/elm_list.c

index 53fec14..f801889 100644 (file)
@@ -425,6 +425,23 @@ _elm_list_unwalk(Widget_Data *wd)
      }
 }
 
+// FIXME : This function might be unnecessary, fix self deletion bug then remove this function.
+static void
+_del_pre_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+
+   if (wd->scr)
+     evas_object_event_callback_del_full
+                     (wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
+                      obj);
+   if (wd->box)
+     evas_object_event_callback_del_full
+                     (wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
+                      obj);
+}
+
 static void
 _del_hook(Evas_Object *obj)
 {
@@ -1291,6 +1308,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);