Am Tue, 14 Apr 2009 15:00:33 -0400 schrieb Christopher Michael:

> Enlightenment SVN wrote:
> > Log:
> >   - correct free
> >   - 'if' arround free cfdata - it's better like this
> 
> <snip>
> 
> 
> How is it better with the 'if' around cfdata ? If cfdata didn't exist
> in the first place then there are bigger problems with this
> module/config dialog....so really the 'if' check is kinda useless.

+   if (cfdata)
    {
-      dpms_list = eina_list_remove_list(dpms_list, l);
+      cfdata->standby_slider=NULL;
+      cfdata->suspend_slider=NULL;
+      cfdata->off_slider=NULL;
+      
+      E_FREE(cfdata);
    }
-
-   if (!cfdata) return;
-   cfdata->standby_slider=NULL;
-   cfdata->suspend_slider=NULL;
-   cfdata->off_slider=NULL;
-
-   E_FREE(cfdata);

I only changed the return point of the function. The result is exactly
the same.I would have better changing it to:

E_FREE(cfdata);

and that's all. If it is NULL, then it does nothing and then return at
the end of the function. It it is not NULL, then it frees cfdata. I see
no reason to NULL the pointers in the struct before freeing cfdata or
returning before the end of the function.

regards
Andreas

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to