seoz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=4ec1b6aa7a728bd5a7ea858ea37cce777871168a

commit 4ec1b6aa7a728bd5a7ea858ea37cce777871168a
Author: Daniel Juyung Seo <seojuyu...@gmail.com>
Date:   Wed Oct 2 20:18:49 2013 +0900

    elm_config/elm_image: Internal small refactoring.
    
    1. Use more ELM_SAFE_FREE macro.
    2. Use correct more descriptive macro for timer callback.
---
 src/lib/elm_config.c |  9 +++------
 src/lib/elm_image.c  | 26 ++++++--------------------
 2 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index dd9598c..c2fff03 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -216,7 +216,8 @@ _prop_change_delay_cb(void *data __UNUSED__)
      }
    _prop_config_get();
    _prop_change_delay_timer = NULL;
-   return EINA_FALSE;
+
+   return ECORE_CALLBACK_CANCEL;
 }
 
 static Eina_Bool
@@ -990,11 +991,7 @@ _elm_recache(void)
    edje_file_cache_set(_elm_config->edje_cache);
    edje_collection_cache_set(_elm_config->edje_collection_cache);
 
-   if (_elm_cache_flush_poller)
-     {
-        ecore_poller_del(_elm_cache_flush_poller);
-        _elm_cache_flush_poller = NULL;
-     }
+   ELM_SAFE_FREE(_elm_cache_flush_poller, ecore_poller_del);
    if (_elm_config->cache_flush_enable)
      {
         if (_elm_config->cache_flush_poll_interval > 0)
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 5a5aecc..fe8c592 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -39,11 +39,7 @@ _on_image_preloaded(void *data,
    Elm_Image_Smart_Data *sd = data;
    sd->preloading = EINA_FALSE;
    if (sd->show) evas_object_show(obj);
-   if (sd->prev_img)
-     {
-        evas_object_del(sd->prev_img);
-        sd->prev_img = NULL;
-     }
+   ELM_SAFE_FREE(sd->prev_img, evas_object_del);
 }
 
 static void
@@ -196,8 +192,7 @@ _elm_image_edje_file_set(Evas_Object *obj,
 
    ELM_IMAGE_DATA_GET(obj, sd);
 
-   if (sd->prev_img) evas_object_del(sd->prev_img);
-   sd->prev_img = NULL;
+   ELM_SAFE_FREE(sd->prev_img, evas_object_del);
 
    if (!sd->edje)
      {
@@ -550,11 +545,7 @@ _elm_image_smart_show(Eo *obj, void *_pd, va_list *list 
EINA_UNUSED)
 
    evas_object_show(sd->img);
 
-   if (sd->prev_img)
-     {
-        evas_object_del(sd->prev_img);
-        sd->prev_img = NULL;
-     }
+   ELM_SAFE_FREE(sd->prev_img, evas_object_del);
 }
 
 static void
@@ -567,8 +558,7 @@ _elm_image_smart_hide(Eo *obj, void *_pd, va_list *list 
EINA_UNUSED)
    sd->show = EINA_FALSE;
    evas_object_hide(sd->img);
 
-   if (sd->prev_img) evas_object_del(sd->prev_img);
-   sd->prev_img = NULL;
+   ELM_SAFE_FREE(sd->prev_img, evas_object_del);
 }
 
 static void
@@ -705,7 +695,7 @@ _elm_image_file_set_do(Evas_Object *obj)
 
    ELM_IMAGE_DATA_GET(obj, sd);
 
-   if (sd->prev_img) evas_object_del(sd->prev_img);
+   ELM_SAFE_FREE(sd->prev_img, evas_object_del);
    if (sd->img)
      {
         pclip = evas_object_clip_get(sd->img);
@@ -1215,11 +1205,7 @@ _elm_image_smart_preload_disabled_set(Eo *obj 
EINA_UNUSED, void *_pd, va_list *l
    if (disable)
      {
         if (sd->show && sd->img) evas_object_show(sd->img);
-        if (sd->prev_img)
-          {
-             evas_object_del(sd->prev_img);
-             sd->prev_img = NULL;
-          }
+        ELM_SAFE_FREE(sd->prev_img, evas_object_del);
      }
 }
 

-- 


Reply via email to