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.
This commit is contained in:
Daniel Juyung Seo 2013-05-29 21:00:12 +09:00
parent 4cea5af2dc
commit 1c1da31da3
1 changed files with 10 additions and 11 deletions

View File

@ -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);