Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text.c 


Log Message:
Fix small mem leak.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- ewl_text.c  31 Oct 2005 15:24:10 -0000      1.38
+++ ewl_text.c  1 Nov 2005 23:24:21 -0000       1.39
@@ -48,7 +48,6 @@
 static unsigned int ewl_text_textblock_cursor_to_index(Evas_Textblock_Cursor 
*cursor);
 
 static void ewl_text_triggers_remove(Ewl_Text *t);
-static void ewl_text_trigger_cb_free(void *value, void *data);
 static void ewl_text_triggers_shift(Ewl_Text *t, unsigned int pos, 
                                                unsigned int len);
 static void ewl_text_trigger_position(Ewl_Text *t, Ewl_Text_Trigger *trig);
@@ -1974,6 +1973,8 @@
 static void
 ewl_text_triggers_remove(Ewl_Text *t)
 {
+       Ewl_Text_Trigger *trig;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("t", t);
        DCHECK_TYPE("t", t, "text");
@@ -1981,7 +1982,9 @@
        if (!t->triggers) 
                DRETURN(DLEVEL_STABLE);
 
-       ecore_list_for_each(t->triggers, ewl_text_trigger_cb_free, NULL);
+       while ((trig = ecore_list_remove_first(t->triggers))) {
+               ewl_text_trigger_free(trig);
+       }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -2093,17 +2096,6 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-static void
-ewl_text_trigger_cb_free(void *value, void *data __UNUSED__)
-{
-       DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("value", value);
-
-       ewl_text_trigger_free(value);
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
 Ewl_Text_Trigger_Type 
 ewl_text_trigger_type_get(Ewl_Text_Trigger *t)
 {
@@ -3805,7 +3797,7 @@
                }
                count += child->length;
        }
-       
+
        DWARNING("Got to the end of function... is that possible?\n");
        DRETURN_PTR(tx, DLEVEL_STABLE);
 }
@@ -4574,17 +4566,21 @@
        }
        else
                snprintf(align, sizeof(align), "align=left");
+
+       ptr = ewl_theme_path_get();
        /* create the formatting string */
        snprintf(fmt, 2048, "+font=fonts/%s font_source=%s font_size=%d "
                        "backing_color=#%02x%02x%02x%02x 
color=#%02x%02x%02x%02x "
                        "%s wrap=%s %s\n", ctx->font, 
-                       ewl_theme_path_get(), ctx->size,
+                       ptr, ctx->size,
                        ctx->style_colors.bg.r, ctx->style_colors.bg.g,
                        ctx->style_colors.bg.b, ctx->style_colors.bg.a,
                        ctx->color.r, ctx->color.g,
                        ctx->color.b, ctx->color.a, style, 
                        ((ctx->wrap) ? "on" : "off"), align);
 
+       IF_FREE(ptr);
+
        DRETURN_PTR(fmt, DLEVEL_STABLE);
 }
 




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to