From ae5fbe49ef9257a75da3c23febe2afa88f0751e2 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 18 Aug 2019 10:28:51 +0100 Subject: elm slider - delete timers on destruction that should be deleted also use safe free to set to null --- src/lib/elementary/elm_slider.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index 97b348bdb4..eab59c1c0d 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -62,6 +62,7 @@ _delay_change(void *data) { ELM_SLIDER_DATA_GET(data, sd); + if (!sd) return ECORE_CALLBACK_CANCEL; sd->delay = NULL; evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL); @@ -972,15 +973,16 @@ EOLIAN static void _elm_slider_efl_object_destructor(Eo *obj, Elm_Slider_Data *sd) { - ecore_timer_del(sd->wheel_indicator_timer); - evas_object_del(sd->popup); - evas_object_del(sd->popup2); + ELM_SAFE_FREE(sd->delay, ecore_timer_del); + ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del); + ELM_SAFE_FREE(sd->popup, evas_object_del); + ELM_SAFE_FREE(sd->popup2, evas_object_del); ELM_SAFE_FREE(sd->indi_template, eina_stringshare_del); - eina_strbuf_free(sd->indi_format_strbuf); + ELM_SAFE_FREE(sd->indi_format_strbuf, eina_strbuf_free); efl_ui_format_func_set(obj, NULL, NULL, NULL); - eina_strbuf_free(sd->format_strbuf); + ELM_SAFE_FREE(sd->format_strbuf, eina_strbuf_free); efl_destructor(efl_super(obj, MY_CLASS)); } -- cgit v1.2.1