Dear All, Hello.

I have resolved the elm_list issue(goto ELM_LIST_CRASH_ISSUE_MAIL below, I
sent mail but I cannot find the previous mail -_-;).
It would be related with double free issue. In the "sub-obejct-del"
callback which name is _sub_del() sets item->icon to NULL.
And in the EVAS_CALLBACK_MOUSE_UP callback funtion which name is
_mouse_up() calls evas_object_unref();
It would try to free the item->icon but the item->icon is already set to
NULL. So.. the crash would occur..

Anyhow my solutiion is the following.

static void
_del_pre_hook(Evas_Object *obj)
{
  Widget_Data *wd = elm_widget_data_get(obj);
  const Eina_List *l;
  Elm_List_Item *it;

  evas_object_smart_callback_del(obj, "sub-object-del", _sub_del);

  if (!wd) return;

  EINA_LIST_FOREACH(wd->items, l, it)
    {
       if (it->icon)
          evas_object_event_callback_del(it->icon,
                                         EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                         _changed_size_hints);
       if (it->end)
          evas_object_event_callback_del(it->icon,
                                         EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                         _changed_size_hints);
    }

  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);
}

I'm not sure this is the best way to resolve the issue. Anyhow the crash
does not occur.
I have checked this issue on the popup, ctxpopup and box already.
Please let me know, if you have any other proper ideas to reslove below
issue.. Thanks.




ELM_LIST_CRASH_ISSUE_MAIL:

Dear All, Hello.

If the elm_list is contained in the container - can be whatever containers
such as box, popup, ctxpopup and so on -
which has item with icon object such as a elm_radio and evas_object_del()
is called in the item select callback, the application is crashed.
If there is no icon on the elm_list item, the crash does not occur. The
example to occur the crash as the following.


{{{
static void _filter_all_cb(void *data, Evas_Object *obj,
              void *event_info)
{
   Evas_Object *popup = (Evas_Object *)data;
   evas_object_del(popup);
}

static void
_popup_center_text_cb(void *data, Evas_Object *obj __UNUSED__,
                     void *event_info __UNUSED__)
{
  Evas_Object *popup, *btn1,*list, *radio;

  popup = elm_popup_add(data);
  evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);

   btn1 = elm_button_add(popup);
   elm_object_text_set(btn1, "OK");
   elm_object_part_content_set(popup, "button1", btn1);
   evas_object_smart_callback_add(btn1, "clicked", NULL, NULL);

   list = elm_list_add(popup);
   evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND,
           EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
   elm_list_mode_set(list, ELM_LIST_EXPAND);
   evas_object_show(list);

   Evas_Object *group;
   group = radio = elm_radio_add(list);
   evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND,
           EVAS_HINT_EXPAND);
   elm_list_item_append(list, "Radio", radio, NULL, _filter_all_cb, popup);
   evas_object_show(radio);

   elm_object_content_set(popup, list);
  evas_object_show(popup);
}

}}}

I will check this issue also, but your help will be pretty good to  me.
Thanks.
Index: src/lib/elm_list.c
===================================================================
--- src/lib/elm_list.c	(revision 69534)
+++ src/lib/elm_list.c	(working copy)
@@ -444,8 +444,25 @@ static void
 _del_pre_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
+   const Eina_List *l;
+   Elm_List_Item *it;
+
+   evas_object_smart_callback_del(obj, "sub-object-del", _sub_del);
+
    if (!wd) return;
 
+   EINA_LIST_FOREACH(wd->items, l, it)
+     {
+        if (it->icon)
+           evas_object_event_callback_del(it->icon,
+                                          EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                          _changed_size_hints);
+        if (it->end)
+           evas_object_event_callback_del(it->icon,
+                                          EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                          _changed_size_hints);
+     }
+
    evas_object_event_callback_del(wd->scr,
                                   EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _changed_size_hints);
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to