use EINA_LIST_FREE for list deletion

SVN revision: 53690
This commit is contained in:
Sebastian Dransfeld 2010-10-20 20:39:38 +00:00
parent b2ecad6a06
commit 423892f7cd
1 changed files with 4 additions and 5 deletions

View File

@ -65,11 +65,10 @@ void *alloca (size_t);
* If x is a valid pointer destroy x and set to NULL * If x is a valid pointer destroy x and set to NULL
*/ */
#define IF_FREE_LIST(list, free_cb) do { \ #define IF_FREE_LIST(list, free_cb) do { \
while (list) \ void *_data; \
{ \ EINA_LIST_FREE(list, _data) \
free_cb(eina_list_data_get(list)); \ free_cb(_data); \
list = eina_list_remove_list(list, list); \ list = NULL; \
} \
} while (0) } while (0)
/** /**