From 35a33263719ff9ead98d10e085e5946d12f8fa75 Mon Sep 17 00:00:00 2001 From: Leandro Dorileo Date: Fri, 14 Dec 2012 20:03:31 +0000 Subject: [PATCH] evas: fix a memory leak introduced on rev 78644 _nodes_clear() is called on object removal and it's not supposed alloc anything at that stage. SVN revision: 80984 --- src/lib/evas/canvas/evas_object_textblock.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 7079d27f16..fa7cad7c6d 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -683,11 +683,6 @@ _nodes_clear(const Evas_Object *eo_obj) o->format_nodes = _NODE_FORMAT(eina_inlist_remove(EINA_INLIST_GET(o->format_nodes), EINA_INLIST_GET(n))); _evas_textblock_node_format_free(o, n); } - - o->cursor->node = _evas_textblock_node_text_new(); - o->text_nodes = _NODE_TEXT(eina_inlist_append( - EINA_INLIST_GET(o->text_nodes), - EINA_INLIST_GET(o->cursor->node))); } /** @@ -5203,7 +5198,14 @@ _textblock_text_markup_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) free(o->markup_text); o->markup_text = NULL; } + _nodes_clear(eo_obj); + + o->cursor->node = _evas_textblock_node_text_new(); + o->text_nodes = _NODE_TEXT(eina_inlist_append( + EINA_INLIST_GET(o->text_nodes), + EINA_INLIST_GET(o->cursor->node))); + if (!o->style && !o->style_user) { if (text != o->markup_text)