forked from enlightenment/enventor
code refactoring - use EINA_LIST_FREE()
This commit is contained in:
parent
56cab4a95c
commit
f06df61b07
|
@ -237,28 +237,11 @@ config_term()
|
|||
eina_stringshare_del(cd->edc_path);
|
||||
eina_stringshare_del(cd->edj_path);
|
||||
|
||||
Eina_List *l;
|
||||
Eina_Stringshare *str;
|
||||
|
||||
//free the image paths
|
||||
EINA_LIST_FOREACH(cd->edc_img_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(cd->edc_img_path_list);
|
||||
|
||||
//free the sound paths
|
||||
EINA_LIST_FOREACH(cd->edc_snd_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(cd->edc_snd_path_list);
|
||||
|
||||
//free the font paths
|
||||
EINA_LIST_FOREACH(cd->edc_fnt_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(cd->edc_fnt_path_list);
|
||||
|
||||
//free the data paths
|
||||
EINA_LIST_FOREACH(cd->edc_data_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(cd->edc_data_path_list);
|
||||
EINA_LIST_FREE(cd->edc_img_path_list, str) eina_stringshare_del(str);
|
||||
EINA_LIST_FREE(cd->edc_snd_path_list, str) eina_stringshare_del(str);
|
||||
EINA_LIST_FREE(cd->edc_fnt_path_list, str) eina_stringshare_del(str);
|
||||
EINA_LIST_FREE(cd->edc_data_path_list, str) eina_stringshare_del(str);
|
||||
|
||||
if (cd->edc_img_path_buf) eina_strbuf_free(cd->edc_img_path_buf);
|
||||
if (cd->edc_snd_path_buf) eina_strbuf_free(cd->edc_snd_path_buf);
|
||||
|
@ -275,11 +258,8 @@ config_edc_snd_path_set(const char *edc_snd_path)
|
|||
config_data *cd = g_cd;
|
||||
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(cd->edc_snd_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
cd->edc_snd_path_list = eina_list_free(cd->edc_snd_path_list);
|
||||
EINA_LIST_FREE(cd->edc_snd_path_list, s) eina_stringshare_del(s);
|
||||
|
||||
if (cd->edc_snd_path_buf) eina_strbuf_free(cd->edc_snd_path_buf);
|
||||
cd->edc_snd_path_buf = eina_strbuf_new();
|
||||
|
@ -320,11 +300,8 @@ config_edc_data_path_set(const char *edc_data_path)
|
|||
config_data *cd = g_cd;
|
||||
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(cd->edc_data_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
cd->edc_data_path_list = eina_list_free(cd->edc_data_path_list);
|
||||
EINA_LIST_FREE(cd->edc_data_path_list, s) eina_stringshare_del(s);
|
||||
|
||||
if (cd->edc_data_path_buf) eina_strbuf_free(cd->edc_data_path_buf);
|
||||
cd->edc_data_path_buf = eina_strbuf_new();
|
||||
|
@ -365,11 +342,8 @@ config_edc_fnt_path_set(const char *edc_fnt_path)
|
|||
config_data *cd = g_cd;
|
||||
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(cd->edc_fnt_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
cd->edc_fnt_path_list = eina_list_free(cd->edc_fnt_path_list);
|
||||
EINA_LIST_FREE(cd->edc_fnt_path_list, s) eina_stringshare_del(s);
|
||||
|
||||
if (cd->edc_fnt_path_buf) eina_strbuf_free(cd->edc_fnt_path_buf);
|
||||
cd->edc_fnt_path_buf = eina_strbuf_new();
|
||||
|
@ -410,11 +384,8 @@ config_edc_img_path_set(const char *edc_img_path)
|
|||
config_data *cd = g_cd;
|
||||
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(cd->edc_img_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
cd->edc_img_path_list = eina_list_free(cd->edc_img_path_list);
|
||||
EINA_LIST_FREE(cd->edc_img_path_list, s) eina_stringshare_del(s);
|
||||
|
||||
if (cd->edc_img_path_buf) eina_strbuf_free(cd->edc_img_path_buf);
|
||||
cd->edc_img_path_buf = eina_strbuf_new();
|
||||
|
|
|
@ -133,15 +133,13 @@ void dummy_obj_del(Evas_Object *layout)
|
|||
dummy_obj *dummy = evas_object_data_get(layout, DUMMYOBJ);
|
||||
if (!dummy) return;
|
||||
|
||||
Eina_List *l;
|
||||
part_obj *po;
|
||||
EINA_LIST_FOREACH(dummy->swallows, l, po)
|
||||
EINA_LIST_FREE(dummy->swallows, po)
|
||||
{
|
||||
evas_object_del(po->obj);
|
||||
eina_stringshare_del(po->name);
|
||||
free(po);
|
||||
}
|
||||
eina_list_free(dummy->swallows);
|
||||
|
||||
if (dummy->animator) ecore_animator_del(dummy->animator);
|
||||
free(dummy);
|
||||
|
|
|
@ -278,7 +278,6 @@ parser_term(parser_data *pd)
|
|||
{
|
||||
if (pd->thread) ecore_thread_cancel(pd->thread);
|
||||
|
||||
Eina_List *l;
|
||||
parser_attr *attr;
|
||||
Eina_Stringshare *str;
|
||||
|
||||
|
@ -288,10 +287,7 @@ parser_term(parser_data *pd)
|
|||
pd->attrs = eina_inlist_remove(pd->attrs, pd->attrs);
|
||||
|
||||
eina_stringshare_del(attr->keyword);
|
||||
|
||||
EINA_LIST_FOREACH(attr->value.strs, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(attr->value.strs);
|
||||
EINA_LIST_FREE(attr->value.strs, str) eina_stringshare_del(str);
|
||||
free(attr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue