seoz pushed a commit to branch master.

commit a6116b02d04d9259edb4e94691d6e7a62c76d1fe
Author: Daniel Juyung Seo <[email protected]>
Date:   Sun Sep 8 18:50:00 2013 +0900

    elm_gengrid.c: more ELM_SAFE_FREE macro for gengrid.
---
 src/lib/elm_gengrid.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 7b256f9..c8269d2 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -660,10 +660,8 @@ _elm_gengrid_item_index_update(Elm_Gen_Item *it)
 static void
 _item_unrealize_cb(Elm_Gen_Item *it)
 {
-   evas_object_del(VIEW(it));
-   VIEW(it) = NULL;
-   evas_object_del(it->spacer);
-   it->spacer = NULL;
+   ELM_SAFE_FREE(VIEW(it), evas_object_del);
+   ELM_SAFE_FREE(it->spacer, evas_object_del);
 }
 
 static char *
@@ -2233,11 +2231,7 @@ _elm_gengrid_clear(Evas_Object *obj,
 
    if (!standby) sd->generation++;
 
-   if (sd->state)
-     {
-        eina_inlist_sorted_state_free(sd->state);
-        sd->state = NULL;
-     }
+   ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free);
 
    if (sd->walking > 0)
      {
@@ -2450,8 +2444,7 @@ _elm_gengrid_smart_del(Eo *obj, void *_pd, va_list *list 
EINA_UNUSED)
 
    elm_gengrid_clear(obj);
    eo_unref(sd->pan_obj);
-   evas_object_del(sd->pan_obj);
-   sd->pan_obj = NULL;
+   ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
    ELM_SAFE_FREE(sd->stack, evas_object_del);
 
    if (sd->calc_job) ecore_job_del(sd->calc_job);
@@ -3330,8 +3323,7 @@ elm_gengrid_item_cursor_unset(Elm_Object_Item *item)
    if (VIEW(it))
      elm_widget_item_cursor_unset(it);
 
-   eina_stringshare_del(it->mouse_cursor);
-   it->mouse_cursor = NULL;
+   ELM_SAFE_FREE(it->mouse_cursor, eina_stringshare_del);
 }
 
 EAPI void

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk

Reply via email to