seoz pushed a commit to branch master.
commit fe417670fe95505f3ebb45a0d259834c5c24cb55
Author: Daniel Juyung Seo <[email protected]>
Date: Wed May 29 21:05:37 2013 +0900
elm_photocam.c: ELM_SAFE_FREE adoption.
I splited ELM_SAFE_FREE refactoring patches. One commit per each file as
recommended.
For the detail, please refer 3072dab12f12fe83fb5a628d15efd5cded11787f.
---
src/lib/elm_photocam.c | 31 ++++++++++++-------------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c
index 06245c7..2f8024d 100644
--- a/src/lib/elm_photocam.c
+++ b/src/lib/elm_photocam.c
@@ -834,7 +834,7 @@ _mouse_down_cb(void *data,
else
evas_object_smart_callback_call(data, SIG_PRESS, NULL);
sd->longpressed = EINA_FALSE;
- ELM_FREE_FUNC(sd->long_timer, ecore_timer_del);
+ if (sd->long_timer) ecore_timer_del(sd->long_timer);
sd->long_timer = ecore_timer_add
(_elm_config->longpress_timeout, _long_press_cb, data);
}
@@ -852,7 +852,7 @@ _mouse_up_cb(void *data,
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
else sd->on_hold = EINA_FALSE;
- ELM_FREE_FUNC(sd->long_timer, ecore_timer_del);
+ ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
if (!sd->on_hold)
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
sd->on_hold = EINA_FALSE;
@@ -935,7 +935,7 @@ _scroll_cb(Evas_Object *obj,
if (sd->no_smooth == 1) _smooth_update(obj);
}
- ELM_FREE_FUNC(sd->scr_timer, ecore_timer_del);
+ if (sd->scr_timer) ecore_timer_del(sd->scr_timer);
sd->scr_timer = ecore_timer_add(0.5, _scroll_timeout_cb, obj);
evas_object_smart_callback_call(obj, SIG_SCROLL, NULL);
@@ -1162,11 +1162,7 @@ _g_layer_zoom_start_cb(void *data,
Evas_Coord rw, rh;
int x, y, w, h;
- if (sd->g_layer_zoom.bounce.animator)
- {
- ecore_animator_del(sd->g_layer_zoom.bounce.animator);
- sd->g_layer_zoom.bounce.animator = NULL;
- }
+ ELM_SAFE_FREE(sd->g_layer_zoom.bounce.animator, ecore_animator_del);
sd->zoom_g_layer = EINA_TRUE;
eo_do(obj, elm_scrollable_interface_freeze_set(EINA_TRUE));
@@ -1391,12 +1387,13 @@ _elm_photocam_smart_del(Eo *obj, void *_pd, va_list
*list EINA_UNUSED)
evas_object_del(sd->pan_obj);
sd->pan_obj = NULL;
- ELM_FREE_FUNC(sd->file, eina_stringshare_del);
- ELM_FREE_FUNC(sd->calc_job, ecore_job_del);
- ELM_FREE_FUNC(sd->scr_timer, ecore_timer_del);
- ELM_FREE_FUNC(sd->long_timer, ecore_timer_del);
- ELM_FREE_FUNC(sd->zoom_animator, ecore_animator_del);
- ELM_FREE_FUNC(sd->g_layer_zoom.bounce.animator, ecore_animator_del);
+ if (sd->file) eina_stringshare_del(sd->file);
+ if (sd->calc_job) ecore_job_del(sd->calc_job);
+ if (sd->scr_timer) ecore_timer_del(sd->scr_timer);
+ if (sd->long_timer) ecore_timer_del(sd->long_timer);
+ if (sd->zoom_animator) ecore_animator_del(sd->zoom_animator);
+ if (sd->g_layer_zoom.bounce.animator)
+ ecore_animator_del(sd->g_layer_zoom.bounce.animator);
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
}
@@ -1503,11 +1500,7 @@ _file_set(Eo *obj, void *_pd, va_list *list)
sd->size.imh = h;
sd->size.w = sd->size.imw / sd->zoom;
sd->size.h = sd->size.imh / sd->zoom;
- if (sd->g_layer_zoom.bounce.animator)
- {
- ecore_animator_del(sd->g_layer_zoom.bounce.animator);
- sd->g_layer_zoom.bounce.animator = NULL;
- }
+ ELM_SAFE_FREE(sd->g_layer_zoom.bounce.animator, ecore_animator_del);
if (sd->zoom_animator)
{
sd->no_smooth--;
--
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1