elm genlist: Modified genlist object reference checking.
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 05:42:29 +0000 (05:42 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 05:42:29 +0000 (05:42 +0000)
On Thu, Aug 4, 2011 at 7:11 PM, Hyoyoung Chang
<hyoyoung.chang@samsung.com> wrote:
> Yeah, you're right.
> Could review improve version of previous patch?
> I attached it.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@62190 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c

index 88edd24..b6577b5 100644 (file)
@@ -540,12 +540,6 @@ _del_hook(Evas_Object *obj)
    if (wd->multi_timer) ecore_timer_del(wd->multi_timer);
    if (wd->mode_type) eina_stringshare_del(wd->mode_type);
    if (wd->scr_hold_timer) ecore_timer_del(wd->scr_hold_timer);
-   if (wd->walking > 0)
-     {
-        wd->walking = 0;
-        elm_genlist_clear(obj);
-     }
-
    free(wd);
 }
 
@@ -833,16 +827,10 @@ _item_select(Elm_Genlist_Item *it)
    it->selected = EINA_TRUE;
    it->wd->selected = eina_list_append(it->wd->selected, it);
 call:
+   evas_object_ref(it->base.widget);
    it->walking++;
    it->wd->walking++;
-   if (it->func.func)
-     {
-        Evas_Object *baseobj = it->base.widget;
-        const char *objtype = NULL;
-        it->func.func((void *)it->func.data, it->base.widget, it);
-        objtype = evas_object_type_get(baseobj);
-        if ((!objtype) || (!strcmp(objtype,""))) return;
-     }
+   if (it->func.func) it->func.func((void *)it->func.data, it->base.widget, it);
    if (!it->delete_me)
      evas_object_smart_callback_call(it->base.widget, SIG_SELECTED, it);
    it->walking--;
@@ -857,6 +845,7 @@ call:
           }
      }
    it->wd->last_selected_item = it;
+   evas_object_unref(it->base.widget);
 }
 
 static void