Add macro to free lists.

SVN revision: 31317
This commit is contained in:
Sebastian Dransfeld 2007-08-15 05:48:47 +00:00
parent 285c459983
commit 67ee15f072
2 changed files with 17 additions and 9 deletions

View File

@ -119,6 +119,22 @@ typedef struct _E_Rect E_Rect;
#define E_NEW(s, n) (s *)calloc(n, sizeof(s))
#define E_NEW_BIG(s, n) (s *)malloc(n * sizeof(s))
#define E_FREE(p) do { if (p) {free(p); p = NULL;} } while (0)
#define E_FREE_LIST(list, free) \
do \
{ \
if (list) \
{ \
Evas_List *tmp; \
tmp = list; \
list = NULL; \
while (tmp) \
{ \
free(tmp->data); \
tmp = evas_list_remove_list(tmp, tmp); \
} \
} \
} \
while (0)
#define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x))

View File

@ -2206,20 +2206,12 @@ e_actions_init(void)
EAPI int
e_actions_shutdown(void)
{
Evas_List *l;
e_action_predef_name_all_del();
action_names = evas_list_free(action_names);
evas_hash_free(actions);
actions = NULL;
l = action_list;
action_list = NULL;
while (l)
{
e_object_del(E_OBJECT(l->data));
l = evas_list_remove_list(l, l);
}
E_FREE_LIST(action_list, e_object_del);
return 1;
}