Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text.c 


Log Message:
- make sure the formatting nodes get cleaned up

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -3 -r1.146 -r1.147
--- ewl_text.c  17 Dec 2006 16:45:28 -0000      1.146
+++ ewl_text.c  22 Dec 2006 19:43:41 -0000      1.147
@@ -45,6 +45,7 @@
                                                unsigned int char_idx,
                                                unsigned int char_len);
 static void ewl_text_fmt_walk(Ewl_Text *t);
+static void ewl_text_cb_fmt_free(Ewl_Text_Fmt *fmt);
 
 static void ewl_text_text_insert_private(Ewl_Text *t, const char *txt, 
                                unsigned int char_idx, unsigned int *char_len, 
@@ -143,6 +144,8 @@
        t->formatting.nodes = ecore_dlist_new();
        if (!t->formatting.nodes) 
                DRETURN_INT(FALSE, DLEVEL_STABLE);
+       ecore_dlist_set_free_cb(t->formatting.nodes, 
+                                       ECORE_FREE_CB(ewl_text_cb_fmt_free));
 
        t->formatting.current.tx = ewl_text_context_default_create(t);
        ewl_text_context_acquire(t->formatting.current.tx);
@@ -5812,5 +5815,18 @@
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
+
+static void
+ewl_text_cb_fmt_free(Ewl_Text_Fmt *fmt)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("fmt", fmt);
+
+       ewl_text_context_release(fmt->tx);
+       FREE(fmt);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
 
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to