Hi,

Attached goes a patch which fix a memory leak introduced on rev 78644.

Tom, since you've commited the fix, could you take a look at it? I intend
to commit it by tomorrow if you don't object to it.

Regards...

-- 
Leandro Dorileo
ProFUSION embedded systems
http://profusion.mobi
>From f990e2bd9b7635c2fa26f3007879a7496a78861e Mon Sep 17 00:00:00 2001
From: Leandro Dorileo <[email protected]>
Date: Thu, 13 Dec 2012 16:09:11 -0200
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.
---
 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 7079d27..fa7cad7 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)
-- 
1.8.0.2

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to