On Wed, Oct 20, 2010 at 6:39 PM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
>  use EINA_LIST_FREE for list deletion
> Author:       englebass
> Date:         2010-10-20 13:39:38 -0700 (Wed, 20 Oct 2010)
> New Revision: 53690
>
> Modified:
>  trunk/efreet/src/lib/efreet_private.h
>
> Modified: trunk/efreet/src/lib/efreet_private.h
> ===================================================================
> --- trunk/efreet/src/lib/efreet_private.h       2010-10-20 20:39:19 UTC (rev 
> 53689)
> +++ trunk/efreet/src/lib/efreet_private.h       2010-10-20 20:39:38 UTC (rev 
> 53690)
> @@ -65,11 +65,10 @@
>  * If x is a valid pointer destroy x and set to NULL
>  */
>  #define IF_FREE_LIST(list, free_cb) do { \
> -    while (list) \
> -    { \
> -        free_cb(eina_list_data_get(list)); \
> -        list = eina_list_remove_list(list, list); \
> -    } \
> +    void *_data; \
> +    EINA_LIST_FREE(list, _data) \
> +        free_cb(_data); \
> +    list = NULL; \
>  } while (0)

list = NULL is worthless, EINA_LIST_FREE updates list... and just
stops when it reaches NULL :-)

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to