seoz pushed a commit to branch master.
commit eb13bb0ff3f14ad498178c9c19e257f6628b6d30
Author: Daniel Juyung Seo <[email protected]>
Date: Wed May 29 21:00:12 2013 +0900
elm_list.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_list.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 7b46512..5f487dd 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -70,12 +70,11 @@ _elm_list_item_free(Elm_List_Item *it)
(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_size_hints_changed_cb, WIDGET(it));
- eina_stringshare_del(it->label);
-
- ELM_FREE_FUNC(it->swipe_timer, ecore_timer_del);
- ELM_FREE_FUNC(it->long_timer, ecore_timer_del);
- ELM_FREE_FUNC(it->icon, evas_object_del);
- ELM_FREE_FUNC(it->end, evas_object_del);
+ ELM_SAFE_FREE(it->label, eina_stringshare_del);
+ ELM_SAFE_FREE(it->swipe_timer, ecore_timer_del);
+ ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
+ ELM_SAFE_FREE(it->icon, evas_object_del);
+ ELM_SAFE_FREE(it->end, evas_object_del);
}
static Eina_Bool
@@ -1149,7 +1148,7 @@ _mouse_move_cb(void *data,
if (!sd->on_hold)
{
sd->on_hold = EINA_TRUE;
- ELM_FREE_FUNC(it->long_timer, ecore_timer_del);
+ ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
if (!sd->was_selected)
_item_unselect(it);
}
@@ -1195,10 +1194,10 @@ _mouse_down_cb(void *data,
_item_highlight(it);
sd->longpressed = EINA_FALSE;
- ELM_FREE_FUNC(it->long_timer, ecore_timer_del);
+ if (it->long_timer) ecore_timer_del(it->long_timer);
it->long_timer = ecore_timer_add
(_elm_config->longpress_timeout, _long_press_cb, it);
- ELM_FREE_FUNC(it->swipe_timer, ecore_timer_del);
+ if (it->swipe_timer) ecore_timer_del(it->swipe_timer);
it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it);
/* Always call the callbacks last - the user may delete our context! */
@@ -1232,8 +1231,8 @@ _mouse_up_cb(void *data,
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
else sd->on_hold = EINA_FALSE;
sd->longpressed = EINA_FALSE;
- ELM_FREE_FUNC(it->long_timer, ecore_timer_del);
- ELM_FREE_FUNC(it->swipe_timer, ecore_timer_del);
+ ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
+ ELM_SAFE_FREE(it->swipe_timer, ecore_timer_del);
if (sd->on_hold)
{
if (sd->swipe) _swipe_do(data);
--
------------------------------------------------------------------------------
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