itc->version = CLASS_ALLOCATED;
itc->refcount = 1;
+ itc->delete_me = EINA_FALSE;
return 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;
if (itc && (itc->version == CLASS_ALLOCATED))
{
if (itc->refcount > 0) itc->refcount--;
- if (!itc->refcount) elm_genlist_item_class_free(itc);
+ if (itc->delete_me && (!itc->refcount))
+ elm_genlist_item_class_free(itc);
}
}