From 97eda67737856c062018c8deb88961b602fa89ba Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Thu, 8 Jun 2017 08:50:14 +0300 Subject: [PATCH] Ui text: fix leak of selection on destruction --- src/lib/elementary/efl_ui_text.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 49319f12e3..235f6f99e7 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -270,6 +270,7 @@ static inline Eo * _decoration_create(Efl_Ui_Text_Data *sd, const char *file, co static void _decoration_defer(Eo *obj); static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd); static void _unused_item_objs_free(Efl_Ui_Text_Data *sd); +static void _clear_text_selection(Efl_Ui_Text_Data *sd); static Mod_Api * _module_find(Evas_Object *obj EINA_UNUSED) @@ -3257,6 +3258,7 @@ _efl_ui_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Text_Data *sd) _anchors_clear_all(obj, sd); _unused_item_objs_free(sd); + _clear_text_selection(sd); text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, @@ -4731,6 +4733,18 @@ _update_text_cursors(Eo *obj) } } +static void +_clear_text_selection(Efl_Ui_Text_Data *sd) +{ + Efl_Ui_Text_Rectangle *r; + + EINA_LIST_FREE(sd->sel, r) + { + free(r); + } + +} + static void _update_text_selection(Eo *obj, Eo *text_obj) {