From: Tae-Hwan Kim Date: Sat, 4 May 2013 10:06:50 +0000 (+0900) Subject: [Genlist] Fix item class unref/free usage X-Git-Tag: accepted/tizen/20130927.071315^2~362 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=593fff76a68a4f5b8f3c1620e0547b0a8caf2390;p=profile%2Fmobile%2Felementary.git [Genlist] Fix item class unref/free usage 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 --- diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 54a71a1..dc3e1f0 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -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); } }