elementary/elm_conform
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 27 Jun 2011 11:31:32 +0000 (11:31 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 27 Jun 2011 11:31:32 +0000 (11:31 +0000)
> -----Original Message-----
> *From:* "cnook"<kimcinoo@gmail.com>
> *To:* enlightenment-devel@lists.sourceforge.net
> *Cc:*
> *Sent:* 11-06-27(월) 14:19:14
> *Subject:* [E-devel] [Patch][elm_conform] add del_pre_hook for removing
> handlerDear All,
>
> Hello,
> I have got elm_confrom does not remove its handler while it is deleted.
> This patch is for that. Please review attached patch. Thanks always.
>
> Sincerely,
> Shinwoo Kim.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@60729 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_conform.c

index 9c4eeb9..a1b704f 100644 (file)
@@ -51,6 +51,7 @@ static char *sub_type[SUB_TYPE_COUNT] = { "scroller", "genlist" };
 
 /* local function prototypes */
 static const char *widtype = NULL;
+static void _del_pre_hook(Evas_Object *obj);
 static void _del_hook(Evas_Object *obj);
 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void _theme_hook(Evas_Object *obj);
@@ -73,6 +74,16 @@ static Eina_Bool _prop_change(void *data, int type, void *event);
 
 /* local functions */
 static void
+_del_pre_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+#ifdef HAVE_ELEMENTARY_X
+   if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl);
+#endif
+}
+
+static void
 _del_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -454,6 +465,7 @@ elm_conformant_add(Evas_Object *parent)
    elm_widget_type_set(obj, "conformant");
    elm_widget_sub_object_add(parent, obj);
    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_can_focus_set(obj, EINA_FALSE);