[Genlist] Fix item class unref/free usage
authorTae-Hwan Kim <the81.kim@samsung.com>
Sat, 4 May 2013 10:06:50 +0000 (19:06 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:49:56 +0000 (13:49 +0900)
1. unref - lower reference count or if it is 0, call item class free
2. free - delet all callbacks, if reference count is 0, free item or
if it is not, call item class unref

Change-Id: If370d2e6babd60ef43446a7c1ce88c79d7b71462

src/lib/elm_genlist.c

index 54a71a1..dc3e1f0 100644 (file)
@@ -6959,7 +6959,6 @@ elm_genlist_item_class_new(void)
 
    itc->version = CLASS_ALLOCATED;
    itc->refcount = 1;
-   itc->delete_me = EINA_FALSE;
 
    return itc;
 }
@@ -6969,7 +6968,6 @@ elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc)
 {
    if (itc && (itc->version == CLASS_ALLOCATED))
      {
-        itc->delete_me = EINA_TRUE;
         itc->func.text_get = NULL;
         itc->func.content_get = NULL;
         itc->func.state_get = NULL;
@@ -6999,8 +6997,7 @@ elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc)
    if (itc && (itc->version == CLASS_ALLOCATED))
      {
         if (itc->refcount > 0) itc->refcount--;
-        if (itc->delete_me && (!itc->refcount))
-          elm_genlist_item_class_free(itc);
+        if (!itc->refcount) elm_genlist_item_class_free(itc);
      }
 }