From 1c1da31da3082cabab1b05798533ac21520a1bd4 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Wed, 29 May 2013 21:00:12 +0900 Subject: [PATCH] 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. --- legacy/elementary/src/lib/elm_list.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 7b4651262a..5f487dd2bf 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/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);