diff --git a/legacy/elementary/src/lib/elm_gesture_layer.c b/legacy/elementary/src/lib/elm_gesture_layer.c index acae1d0503..f31231e5b7 100644 --- a/legacy/elementary/src/lib/elm_gesture_layer.c +++ b/legacy/elementary/src/lib/elm_gesture_layer.c @@ -1398,11 +1398,7 @@ _tap_gestures_test_reset(Gesture_Info *gesture) EINA_SAFETY_ON_NULL_RETURN(gesture); ELM_GESTURE_LAYER_DATA_GET(gesture->obj, sd); - if (sd->gest_taps_timeout) - { - ecore_timer_del(sd->gest_taps_timeout); - sd->gest_taps_timeout = NULL; - } + ELM_FREE_FUNC(sd->gest_taps_timeout, ecore_timer_del); if (!gesture->data) return; @@ -1433,11 +1429,7 @@ _n_long_tap_test_reset(Gesture_Info *gesture) free(p); st->touched = NULL; - if (st->timeout) - { - ecore_timer_del(st->timeout); - st->timeout = NULL; - } + ELM_FREE_FUNC(st->timeout, ecore_timer_del); memset(gesture->data, 0, sizeof(Long_Tap_Type)); } @@ -1989,11 +1981,7 @@ _n_long_tap_test(Evas_Object *obj, ev_flag = _state_set(gesture, ELM_GESTURE_STATE_ABORT, &st->info, EINA_FALSE); - if (st->timeout) - { - ecore_timer_del(st->timeout); - st->timeout = NULL; - } + ELM_FREE_FUNC(st->timeout, ecore_timer_del); _event_consume(sd, event_info, event_type, ev_flag); } @@ -2013,11 +2001,7 @@ _n_long_tap_test(Evas_Object *obj, /* ABORT if user moved fingers out of tap area */ if (!_inside(x, y, st->center_x, st->center_y)) { - if (st->timeout) - { - ecore_timer_del(st->timeout); - st->timeout = NULL; - } + ELM_FREE_FUNC(st->timeout, ecore_timer_del); /* Report MOVE if gesture started */ ev_flag = _state_set(gesture, ELM_GESTURE_STATE_ABORT, @@ -3638,11 +3622,7 @@ _elm_gesture_layer_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) free(sd->gesture[i]); } - if (sd->gest_taps_timeout) - { - ecore_timer_del(sd->gest_taps_timeout); - sd->gest_taps_timeout = NULL; - } + ELM_FREE_FUNC(sd->gest_taps_timeout, ecore_timer_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_image.c b/legacy/elementary/src/lib/elm_image.c index dc679ba0db..517485adf1 100644 --- a/legacy/elementary/src/lib/elm_image.c +++ b/legacy/elementary/src/lib/elm_image.c @@ -664,11 +664,9 @@ _elm_image_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Image_Smart_Data *sd = _pd; - if (sd->anim_timer) - ecore_timer_del(sd->anim_timer); - - evas_object_del(sd->img); - if (sd->prev_img) evas_object_del(sd->prev_img); + ELM_FREE_FUNC(sd->anim_timer, ecore_timer_del); + ELM_FREE_FUNC(sd->img, evas_object_del); + ELM_FREE_FUNC(sd->prev_img, evas_object_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } @@ -1511,11 +1509,7 @@ _elm_image_smart_animated_play_set(Eo *obj, void *_pd, va_list *list) } else { - if (sd->anim_timer) - { - ecore_timer_del(sd->anim_timer); - sd->anim_timer = NULL; - } + ELM_FREE_FUNC(sd->anim_timer, ecore_timer_del); } sd->play = play; } diff --git a/legacy/elementary/src/lib/elm_index.c b/legacy/elementary/src/lib/elm_index.c index 1c3a41fdcf..879f32bc27 100644 --- a/legacy/elementary/src/lib/elm_index.c +++ b/legacy/elementary/src/lib/elm_index.c @@ -651,7 +651,7 @@ _sel_eval(Evas_Object *obj, else evas_object_smart_callback_call (obj, SIG_CHANGED, it); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); sd->delay = ecore_timer_add(sd->delay_change_time, _delay_change_cb, obj); } @@ -996,7 +996,7 @@ _elm_index_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) EINA_LIST_FREE(sd->omit, o) free(o); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } @@ -1245,7 +1245,7 @@ elm_index_item_selected_set(Elm_Object_Item *it, (obj, SIG_CHANGED, it); evas_object_smart_callback_call (obj, SIG_SELECTED, it); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); sd->delay = ecore_timer_add(sd->delay_change_time, _delay_change_cb, obj); } diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index ba31f20c41..dbfe64ba41 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -72,12 +72,10 @@ _elm_list_item_free(Elm_List_Item *it) eina_stringshare_del(it->label); - if (it->swipe_timer) ecore_timer_del(it->swipe_timer); - it->swipe_timer = NULL; - if (it->long_timer) ecore_timer_del(it->long_timer); - it->long_timer = NULL; - if (it->icon) evas_object_del(it->icon); - if (it->end) evas_object_del(it->end); + 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); } static Eina_Bool @@ -1151,11 +1149,7 @@ _mouse_move_cb(void *data, if (!sd->on_hold) { sd->on_hold = EINA_TRUE; - if (it->long_timer) - { - ecore_timer_del(it->long_timer); - it->long_timer = NULL; - } + ELM_FREE_FUNC(it->long_timer, ecore_timer_del); if (!sd->was_selected) _item_unselect(it); } @@ -1201,10 +1195,10 @@ _mouse_down_cb(void *data, _item_highlight(it); sd->longpressed = EINA_FALSE; - if (it->long_timer) ecore_timer_del(it->long_timer); + ELM_FREE_FUNC(it->long_timer, ecore_timer_del); it->long_timer = ecore_timer_add (_elm_config->longpress_timeout, _long_press_cb, it); - if (it->swipe_timer) ecore_timer_del(it->swipe_timer); + ELM_FREE_FUNC(it->swipe_timer, ecore_timer_del); it->swipe_timer = ecore_timer_add(0.4, _swipe_cancel, it); /* Always call the callbacks last - the user may delete our context! */ @@ -1238,16 +1232,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; - if (it->long_timer) - { - ecore_timer_del(it->long_timer); - it->long_timer = NULL; - } - if (it->swipe_timer) - { - ecore_timer_del(it->swipe_timer); - it->swipe_timer = NULL; - } + ELM_FREE_FUNC(it->long_timer, ecore_timer_del); + ELM_FREE_FUNC(it->swipe_timer, ecore_timer_del); if (sd->on_hold) { if (sd->swipe) _swipe_do(data); diff --git a/legacy/elementary/src/lib/elm_map.c b/legacy/elementary/src/lib/elm_map.c index b9c475b467..20fc737746 100644 --- a/legacy/elementary/src/lib/elm_map.c +++ b/legacy/elementary/src/lib/elm_map.c @@ -625,7 +625,7 @@ _grid_item_update(Grid_Item *gi) gi->file_have = EINA_TRUE; } - if (gi->wsd->loaded_timer) ecore_timer_del(gi->wsd->loaded_timer); + ELM_FREE_FUNC(gi->wsd->loaded_timer, ecore_timer_del); gi->wsd->loaded_timer = ecore_timer_add(0.25, _loaded_timeout_cb, gi->wsd->obj); } @@ -1272,7 +1272,7 @@ _mouse_down_cb(void *data, evas_object_smart_callback_call (sd->obj, SIG_PRESS, ev); - if (sd->long_timer) ecore_timer_del(sd->long_timer); + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); sd->ev = *ev; sd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_cb, data); @@ -1294,11 +1294,7 @@ _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; - if (sd->long_timer) - { - ecore_timer_del(sd->long_timer); - sd->long_timer = NULL; - } + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); if (!sd->on_hold) evas_object_smart_callback_call @@ -4105,14 +4101,12 @@ _elm_map_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) EINA_LIST_FREE(sd->track, track) evas_object_del(track); - if (sd->scr_timer) ecore_timer_del(sd->scr_timer); - if (sd->long_timer) ecore_timer_del(sd->long_timer); - - if (sd->user_agent) eina_stringshare_del(sd->user_agent); - if (sd->ua) eina_hash_free(sd->ua); - - if (sd->zoom_timer) ecore_timer_del(sd->zoom_timer); - if (sd->zoom_animator) ecore_animator_del(sd->zoom_animator); + ELM_FREE_FUNC(sd->scr_timer, ecore_timer_del); + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); + ELM_FREE_FUNC(sd->user_agent, eina_stringshare_del); + ELM_FREE_FUNC(sd->ua, eina_hash_free); + ELM_FREE_FUNC(sd->zoom_timer, ecore_timer_del); + ELM_FREE_FUNC(sd->zoom_animator, ecore_animator_del); _grid_all_clear(sd); // Removal of download list should be after grid clear. @@ -4137,12 +4131,8 @@ _elm_map_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) ERR("Deletion of %s failed", buf); } - if (sd->loaded_timer) - { - ecore_timer_del(sd->loaded_timer); - sd->loaded_timer = NULL; - } - if (sd->map) evas_map_free(sd->map); + ELM_FREE_FUNC(sd->loaded_timer, ecore_timer_del); + ELM_FREE_FUNC(sd->map, evas_map_free); eo_unref(sd->pan_obj); evas_object_del(sd->pan_obj); diff --git a/legacy/elementary/src/lib/elm_notify.c b/legacy/elementary/src/lib/elm_notify.c index 7aee3cb4a2..7a1f1f8381 100644 --- a/legacy/elementary/src/lib/elm_notify.c +++ b/legacy/elementary/src/lib/elm_notify.c @@ -259,11 +259,7 @@ static void _timer_init(Evas_Object *obj, Elm_Notify_Smart_Data *sd) { - if (sd->timer) - { - ecore_timer_del(sd->timer); - sd->timer = NULL; - } + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (sd->timeout > 0.0) sd->timer = ecore_timer_add(sd->timeout, _timer_cb, obj); } @@ -290,11 +286,7 @@ _elm_notify_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED) evas_object_hide(sd->notify); if (!sd->allow_events) evas_object_hide(sd->block_events); - if (sd->timer) - { - ecore_timer_del(sd->timer); - sd->timer = NULL; - } + ELM_FREE_FUNC(sd->timer, ecore_timer_del); } static void @@ -466,11 +458,7 @@ _elm_notify_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) elm_notify_parent_set(obj, NULL); elm_notify_allow_events_set(obj, EINA_FALSE); - if (sd->timer) - { - ecore_timer_del(sd->timer); - sd->timer = NULL; - } + ELM_FREE_FUNC(sd->timer, ecore_timer_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_photo.c b/legacy/elementary/src/lib/elm_photo.c index cbf6979391..1e55c05c45 100644 --- a/legacy/elementary/src/lib/elm_photo.c +++ b/legacy/elementary/src/lib/elm_photo.c @@ -137,8 +137,7 @@ _mouse_move(void *data, if (move->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { /* Moved too far: No longpress for you! */ - ecore_timer_del(sd->long_press_timer); - sd->long_press_timer = NULL; + ELM_FREE_FUNC(sd->long_press_timer, ecore_timer_del); evas_object_event_callback_del (icon, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move); } @@ -193,7 +192,7 @@ _mouse_down(void *data, if (ev->button != 1) return; - if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer); + ELM_FREE_FUNC(sd->long_press_timer, ecore_timer_del); sd->long_press_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press_cb, data); evas_object_event_callback_add @@ -212,11 +211,7 @@ _mouse_up(void *data, if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; - if (sd->long_press_timer) - { - ecore_timer_del(sd->long_press_timer); - sd->long_press_timer = NULL; - } + ELM_FREE_FUNC(sd->long_press_timer, ecore_timer_del); evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } @@ -305,8 +300,7 @@ _elm_photo_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Photo_Smart_Data * sd = _pd; - if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer); - sd->long_press_timer = NULL; + ELM_FREE_FUNC(sd->long_press_timer, ecore_timer_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_photocam.c b/legacy/elementary/src/lib/elm_photocam.c index 7fb6733877..06245c7da2 100644 --- a/legacy/elementary/src/lib/elm_photocam.c +++ b/legacy/elementary/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; - if (sd->long_timer) ecore_timer_del(sd->long_timer); + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); sd->long_timer = ecore_timer_add (_elm_config->longpress_timeout, _long_press_cb, data); } @@ -852,11 +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; - if (sd->long_timer) - { - ecore_timer_del(sd->long_timer); - sd->long_timer = NULL; - } + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); if (!sd->on_hold) evas_object_smart_callback_call(data, SIG_CLICKED, NULL); sd->on_hold = EINA_FALSE; @@ -939,7 +935,7 @@ _scroll_cb(Evas_Object *obj, if (sd->no_smooth == 1) _smooth_update(obj); } - if (sd->scr_timer) ecore_timer_del(sd->scr_timer); + ELM_FREE_FUNC(sd->scr_timer, ecore_timer_del); sd->scr_timer = ecore_timer_add(0.5, _scroll_timeout_cb, obj); evas_object_smart_callback_call(obj, SIG_SCROLL, NULL); @@ -1395,13 +1391,12 @@ _elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) evas_object_del(sd->pan_obj); sd->pan_obj = NULL; - 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->zoom_animator) ecore_animator_del(sd->zoom_animator); - if (sd->g_layer_zoom.bounce.animator) - ecore_animator_del(sd->g_layer_zoom.bounce.animator); - if (sd->long_timer) ecore_timer_del(sd->long_timer); + 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); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_slider.c b/legacy/elementary/src/lib/elm_slider.c index dd194b7b01..12591a0890 100644 --- a/legacy/elementary/src/lib/elm_slider.c +++ b/legacy/elementary/src/lib/elm_slider.c @@ -76,7 +76,7 @@ _val_fetch(Evas_Object *obj) { sd->val = val; evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); } } @@ -837,11 +837,10 @@ _elm_slider_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) { Elm_Slider_Smart_Data *sd = _pd; - if (sd->indicator) eina_stringshare_del(sd->indicator); - if (sd->units) eina_stringshare_del(sd->units); - if (sd->delay) ecore_timer_del(sd->delay); - - if (sd->popup) evas_object_del(sd->popup); + ELM_FREE_FUNC(sd->indicator, eina_stringshare_del); + ELM_FREE_FUNC(sd->units, eina_stringshare_del); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); + ELM_FREE_FUNC(sd->popup, evas_object_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_slideshow.c b/legacy/elementary/src/lib/elm_slideshow.c index 8486f2eb6a..725fa4949b 100644 --- a/legacy/elementary/src/lib/elm_slideshow.c +++ b/legacy/elementary/src/lib/elm_slideshow.c @@ -67,10 +67,7 @@ _elm_slideshow_smart_event(Eo *obj, void *_pd, va_list *list) if (sd->timeout) { if (sd->timer) - { - ecore_timer_del(sd->timer); - sd->timer = NULL; - } + ELM_FREE_FUNC(sd->timer, ecore_timer_del); else elm_slideshow_timeout_set(obj, sd->timeout); } @@ -356,8 +353,8 @@ _elm_slideshow_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) const char *layout; elm_slideshow_clear(obj); - elm_widget_stringlist_free(sd->transitions); - if (sd->timer) ecore_timer_del(sd->timer); + ELM_FREE_FUNC(sd->transitions, elm_widget_stringlist_free); + ELM_FREE_FUNC(sd->timer, ecore_timer_del); EINA_LIST_FREE(sd->layout.list, layout) eina_stringshare_del(layout); @@ -479,8 +476,7 @@ elm_slideshow_item_show(Elm_Object_Item *it) next = item; _on_slideshow_end(WIDGET(item), WIDGET(item), NULL, NULL); - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (sd->timeout > 0.0) sd->timer = ecore_timer_add(sd->timeout, _timer_cb, WIDGET(item)); @@ -519,8 +515,7 @@ _elm_slideshow_next(Eo *obj, void *_pd, va_list *list EINA_UNUSED) _on_slideshow_end(obj, obj, NULL, NULL); - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (sd->timeout > 0.0) sd->timer = ecore_timer_add(sd->timeout, _timer_cb, obj); @@ -560,8 +555,7 @@ _elm_slideshow_previous(Eo *obj, void *_pd, va_list *list EINA_UNUSED) _on_slideshow_end(obj, obj, NULL, NULL); - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (sd->timeout > 0.0) sd->timer = ecore_timer_add(sd->timeout, _timer_cb, obj); @@ -665,9 +659,7 @@ _elm_slideshow_timeout_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list) sd->timeout = timeout; - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; - + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (timeout > 0.0) sd->timer = ecore_timer_add(timeout, _timer_cb, obj); } diff --git a/legacy/elementary/src/lib/elm_spinner.c b/legacy/elementary/src/lib/elm_spinner.c index 441148e9ce..adf3c4590b 100644 --- a/legacy/elementary/src/lib/elm_spinner.c +++ b/legacy/elementary/src/lib/elm_spinner.c @@ -146,7 +146,7 @@ _value_set(Evas_Object *obj, sd->val = new_val; evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); sd->delay = ecore_timer_add(0.2, _delay_change, obj); return EINA_TRUE; @@ -309,7 +309,7 @@ _val_inc_start(Evas_Object *obj) sd->interval = sd->first_interval; sd->spin_speed = sd->step; - if (sd->spin) ecore_timer_del(sd->spin); + ELM_FREE_FUNC(sd->spin, ecore_timer_del); sd->spin = ecore_timer_add(sd->interval, _spin_value, obj); _spin_value(obj); } @@ -321,8 +321,7 @@ _val_inc_stop(Evas_Object *obj) sd->interval = sd->first_interval; sd->spin_speed = 0; - if (sd->spin) ecore_timer_del(sd->spin); - sd->spin = NULL; + ELM_FREE_FUNC(sd->spin, ecore_timer_del); } static void @@ -332,7 +331,7 @@ _val_dec_start(Evas_Object *obj) sd->interval = sd->first_interval; sd->spin_speed = -sd->step; - if (sd->spin) ecore_timer_del(sd->spin); + ELM_FREE_FUNC(sd->spin, ecore_timer_del); sd->spin = ecore_timer_add(sd->interval, _spin_value, obj); _spin_value(obj); } @@ -344,8 +343,7 @@ _val_dec_stop(Evas_Object *obj) sd->interval = sd->first_interval; sd->spin_speed = 0; - if (sd->spin) ecore_timer_del(sd->spin); - sd->spin = NULL; + ELM_FREE_FUNC(sd->spin, ecore_timer_del); } static void @@ -407,7 +405,7 @@ _entry_activated_cb(void *data, _entry_value_apply(data); evas_object_smart_callback_call(data, SIG_CHANGED, NULL); - if (sd->delay) ecore_timer_del(sd->delay); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); sd->delay = ecore_timer_add(0.2, _delay_change, data); } @@ -694,9 +692,10 @@ _elm_spinner_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Spinner_Smart_Data *sd = _pd; - if (sd->label) eina_stringshare_del(sd->label); - if (sd->delay) ecore_timer_del(sd->delay); - if (sd->spin) ecore_timer_del(sd->spin); + ELM_FREE_FUNC(sd->label, eina_stringshare_del); + ELM_FREE_FUNC(sd->delay, ecore_timer_del); + ELM_FREE_FUNC(sd->spin, ecore_timer_del); + if (sd->special_values) { EINA_LIST_FREE(sd->special_values, sv) diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 37f8287c8a..99eeec84d4 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -1883,11 +1883,7 @@ _mouse_up_cb(Elm_Toolbar_Item *it, ELM_TOOLBAR_DATA_GET(WIDGET(it), sd); if (ev->button != 1) return; - if (sd->long_timer) - { - ecore_timer_del(sd->long_timer); - sd->long_timer = NULL; - } + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); evas_object_event_callback_del_full (VIEW(it), EVAS_CALLBACK_MOUSE_MOVE, (Evas_Object_Event_Cb)_mouse_move_cb, it); @@ -2558,16 +2554,8 @@ _elm_toolbar_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) elm_widget_item_del(it); it = next; } - if (sd->more_item) - { - elm_widget_item_del(sd->more_item); - sd->more_item = NULL; - } - if (sd->long_timer) - { - ecore_timer_del(sd->long_timer); - sd->long_timer = NULL; - } + ELM_FREE_FUNC(sd->more_item, elm_widget_item_del); + ELM_FREE_FUNC(sd->long_timer, ecore_timer_del); eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); } diff --git a/legacy/elementary/src/lib/elm_video.c b/legacy/elementary/src/lib/elm_video.c index d55dc8277c..ceac5dbdd6 100644 --- a/legacy/elementary/src/lib/elm_video.c +++ b/legacy/elementary/src/lib/elm_video.c @@ -282,7 +282,7 @@ _elm_video_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) Elm_Video_Smart_Data *sd = _pd; #ifdef HAVE_EMOTION - if (sd->timer) ecore_timer_del(sd->timer); + ELM_FREE_FUNC(sd->timer, ecore_timer_del); if (sd->remember) emotion_object_last_position_save(sd->emotion); #else (void) sd; @@ -392,8 +392,7 @@ _play(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED) if (emotion_object_play_get(sd->emotion)) return; - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; + ELM_FREE_FUNC(sd->timer, ecore_timer_del); sd->stop = EINA_FALSE; emotion_object_play_set(sd->emotion, EINA_TRUE); #else @@ -445,8 +444,7 @@ _stop(Eo *obj, void *_pd, va_list *list EINA_UNUSED) if (!emotion_object_play_get(sd->emotion) && sd->stop) return; - if (sd->timer) ecore_timer_del(sd->timer); - sd->timer = NULL; + ELM_FREE_FUNC(sd->timer, ecore_timer_del); sd->stop = EINA_TRUE; emotion_object_play_set(sd->emotion, EINA_FALSE); diff --git a/legacy/elementary/src/lib/elm_web.c b/legacy/elementary/src/lib/elm_web.c index f29c6fcaac..9b5b28a7dc 100644 --- a/legacy/elementary/src/lib/elm_web.c +++ b/legacy/elementary/src/lib/elm_web.c @@ -312,11 +312,7 @@ _view_smart_mouse_up(Ewk_View_Smart_Data *esd, return EINA_TRUE; } - if (sd->mouse.longpress_timer) - { - ecore_timer_del(sd->mouse.longpress_timer); - sd->mouse.longpress_timer = NULL; - } + ELM_FREE_FUNC(sd->mouse.longpress_timer, ecore_timer_del); sd->mouse.move_count = 0; return _ewk_view_parent_sc.mouse_up(esd, event); @@ -332,12 +328,10 @@ _view_smart_mouse_move(Ewk_View_Smart_Data *esd, sd->mouse.move_count++; - if (sd->mouse.longpress_timer && - (((sd->mouse.x ^ sd->mouse.event.canvas.x) | - (sd->mouse.y ^ sd->mouse.event.canvas.y)) & (~0x07))) + if (((sd->mouse.x ^ sd->mouse.event.canvas.x) | + (sd->mouse.y ^ sd->mouse.event.canvas.y)) & (~0x07)) { - ecore_timer_del(sd->mouse.longpress_timer); - sd->mouse.longpress_timer = NULL; + ELM_FREE_FUNC(sd->mouse.longpress_timer, ecore_timer_del); } if (sd->mouse.pan_anim) @@ -913,8 +907,7 @@ _ewk_view_resized_cb(void *data, if (!(sd->zoom.mode != ELM_WEB_ZOOM_MODE_MANUAL)) return; - if (sd->zoom.timer) - ecore_timer_del(sd->zoom.timer); + ELM_FREE_FUNC(sd->zoom.timer, ecore_timer_del); sd->zoom.timer = ecore_timer_add(0.5, _reset_zoom_timer_cb, data); } @@ -1191,17 +1184,9 @@ _elm_web_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) #ifdef HAVE_ELEMENTARY_WEB Elm_Web_Smart_Data *sd = _pd; - if (sd->zoom.timer) - { - ecore_timer_del(sd->zoom.timer); - sd->zoom.timer = NULL; - } + ELM_FREE_FUNC(sd->zoom.timer, ecore_timer_del); + ELM_FREE_FUNC(sd->bring_in.animator.timer, ecore_animator_del); - if (sd->bring_in.animator) - { - ecore_animator_del(sd->bring_in.animator); - sd->bring_in.animator = NULL; - } #else (void)_pd; #endif diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index bcef268787..39e9230af5 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -1469,10 +1469,11 @@ _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) ecore_evas_callback_delete_request_set(sd->ee, NULL); ecore_evas_callback_resize_set(sd->ee, NULL); } - if (sd->deferred_resize_job) ecore_job_del(sd->deferred_resize_job); - if (sd->deferred_child_eval_job) ecore_job_del(sd->deferred_child_eval_job); - if (sd->shot.info) eina_stringshare_del(sd->shot.info); - if (sd->shot.timer) ecore_timer_del(sd->shot.timer); + + ELM_FREE_FUNC(sd->deferred_resize_job, ecore_job_del); + ELM_FREE_FUNC(sd->deferred_child_eval_job, ecore_job_del); + ELM_FREE_FUNC(sd->shot.info, eina_stringshare_del); + ELM_FREE_FUNC(sd->shot.timer, ecore_timer_del); #ifdef HAVE_ELEMENTARY_X if (sd->x.client_message_handler) diff --git a/legacy/elementary/src/lib/els_tooltip.c b/legacy/elementary/src/lib/els_tooltip.c index 198f6ef449..a54d5cba2b 100644 --- a/legacy/elementary/src/lib/els_tooltip.c +++ b/legacy/elementary/src/lib/els_tooltip.c @@ -260,8 +260,8 @@ _elm_tooltip_hide_anim_stop(Elm_Tooltip *tt) if (!tt->hide_timer) return; if (tt->tooltip) edje_object_signal_emit(tt->tooltip, "elm,action,show", "elm"); - ecore_timer_del(tt->hide_timer); - tt->hide_timer = NULL; + + ELM_FREE_FUNC(tt->hide_timer, ecore_timer_del); } static void @@ -537,8 +537,7 @@ static void _elm_tooltip_show_timer_stop(Elm_Tooltip *tt) { if (!tt->show_timer) return; - ecore_timer_del(tt->show_timer); - tt->show_timer = NULL; + ELM_FREE_FUNC(tt->show_timer, ecore_timer_del); } static Eina_Bool