use EINA_LIST_FREE()
This macro helps releasing a list of elements in efficient and safe way. SVN revision: 39217
This commit is contained in:
parent
d1d91b99df
commit
d7829ccd3c
|
@ -205,11 +205,9 @@ _stringlist_get(const char *str)
|
|||
static void
|
||||
_stringlist_free(Eina_List *list)
|
||||
{
|
||||
while (list)
|
||||
{
|
||||
eina_stringshare_del(list->data);
|
||||
list = eina_list_remove_list(list, list);
|
||||
}
|
||||
const char *s;
|
||||
EINA_LIST_FREE(list, s)
|
||||
eina_stringshare_del(list->data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -406,11 +404,11 @@ _item_unrealize(Elm_Genlist_Item *it)
|
|||
_stringlist_free(it->icons);
|
||||
it->icons = NULL;
|
||||
_stringlist_free(it->states);
|
||||
while (it->icon_objs)
|
||||
{
|
||||
evas_object_del(it->icon_objs->data);
|
||||
it->icon_objs = eina_list_remove_list(it->icon_objs, it->icon_objs);
|
||||
}
|
||||
|
||||
Evas_Object *icon;
|
||||
EINA_LIST_FREE(it->icon_objs, icon)
|
||||
evas_object_del(icon);
|
||||
|
||||
it->states = NULL;
|
||||
it->realized = 0;
|
||||
}
|
||||
|
@ -799,12 +797,11 @@ _item_block_del(Elm_Genlist_Item *it)
|
|||
Item_Block *itbn = (Item_Block *)(il->next);
|
||||
if ((itbp) && ((itbp->count + itb->count) < 48))
|
||||
{
|
||||
while (itb->items)
|
||||
Elm_Genlist_Item *it2;
|
||||
EINA_LIST_FREE(itb->items, it2)
|
||||
{
|
||||
Elm_Genlist_Item *it2 = itb->items->data;
|
||||
it2->block = itbp;
|
||||
itbp->items = eina_list_append(itbp->items, it2);
|
||||
itb->items = eina_list_remove_list(itb->items, itb->items);
|
||||
itbp->count++;
|
||||
itbp->changed = 1;
|
||||
}
|
||||
|
|
|
@ -45,10 +45,10 @@ _del_pre_hook(Evas_Object *obj)
|
|||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_SHOW, _hov_show);
|
||||
evas_object_event_callback_del(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide);
|
||||
while (wd->subs)
|
||||
|
||||
Subinfo *si;
|
||||
EINA_LIST_FREE(wd->subs, si)
|
||||
{
|
||||
Subinfo *si = wd->subs->data;
|
||||
wd->subs = eina_list_remove_list(wd->subs, wd->subs);
|
||||
evas_stringshare_del(si->swallow);
|
||||
free(si);
|
||||
}
|
||||
|
|
|
@ -26,10 +26,9 @@ static void
|
|||
_del_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
while (wd->subs)
|
||||
Subinfo *si;
|
||||
EINA_LIST_FREE(wd->subs, si)
|
||||
{
|
||||
Subinfo *si = wd->subs->data;
|
||||
wd->subs = eina_list_remove_list(wd->subs, wd->subs);
|
||||
evas_stringshare_del(si->swallow);
|
||||
free(si);
|
||||
}
|
||||
|
|
|
@ -42,10 +42,9 @@ static void
|
|||
_del_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
while (wd->items)
|
||||
Elm_List_Item *it;
|
||||
EINA_LIST_FREE(wd->items, it)
|
||||
{
|
||||
Elm_List_Item *it = wd->items->data;
|
||||
wd->items = eina_list_remove_list(wd->items, wd->items);
|
||||
eina_stringshare_del(it->label);
|
||||
if (!it->fixed)
|
||||
{
|
||||
|
|
|
@ -369,12 +369,10 @@ elm_quicklaunch_shutdown(void)
|
|||
eina_stringshare_del(_elm_data_dir);
|
||||
_elm_data_dir = NULL;
|
||||
|
||||
while (_elm_config->font_dirs)
|
||||
{
|
||||
eina_stringshare_del(_elm_config->font_dirs->data);
|
||||
_elm_config->font_dirs = eina_list_remove_list(_elm_config->font_dirs, _elm_config->font_dirs);
|
||||
}
|
||||
|
||||
const char *fontdir;
|
||||
EINA_LIST_FREE(_elm_config->font_dirs, fontdir)
|
||||
eina_stringshare_del(fontdir);
|
||||
|
||||
ecore_event_handler_del(_elm_exit_handler);
|
||||
_elm_exit_handler = NULL;
|
||||
|
||||
|
|
|
@ -190,13 +190,10 @@ _elm_theme_parse(const char *theme)
|
|||
cache = NULL;
|
||||
}
|
||||
cache = eina_hash_string_superfast_new(NULL);
|
||||
|
||||
while (themes)
|
||||
{
|
||||
eina_stringshare_del(themes->data);
|
||||
themes = eina_list_remove_list(themes, themes);
|
||||
}
|
||||
|
||||
|
||||
EINA_LIST_FREE(themes, p)
|
||||
eina_stringshare_del(p);
|
||||
|
||||
themes = names;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -66,10 +66,9 @@ static void
|
|||
_del_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
while (wd->items)
|
||||
Elm_Toolbar_Item *it;
|
||||
EINA_LIST_FREE(wd->items, it)
|
||||
{
|
||||
Elm_Toolbar_Item *it = wd->items->data;
|
||||
wd->items = eina_list_remove_list(wd->items, wd->items);
|
||||
eina_stringshare_del(it->label);
|
||||
if (it->icon) evas_object_del(it->icon);
|
||||
evas_object_del(it->base);
|
||||
|
|
|
@ -788,10 +788,8 @@ _smart_del(Evas_Object *obj)
|
|||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
while (sd->subobjs)
|
||||
EINA_LIST_FREE(sd->subobjs, sobj)
|
||||
{
|
||||
sobj = sd->subobjs->data;
|
||||
sd->subobjs = eina_list_remove_list(sd->subobjs, sd->subobjs);
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
|
|
Loading…
Reference in New Issue