From 21630ba77e5b648554e06dff2a5117811d30b80b Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Mon, 30 Nov 2009 14:33:51 -0800 Subject: [PATCH] fixed a couple of memleaks --- lib/modules/swfalignzones.c | 2 ++ lib/modules/swftext.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/modules/swfalignzones.c b/lib/modules/swfalignzones.c index 027585f..36ddd34 100644 --- a/lib/modules/swfalignzones.c +++ b/lib/modules/swfalignzones.c @@ -156,6 +156,8 @@ static void draw_char(SWFFONT * f, int nr, float*row, float*column, SRECT b) y = l->y; l = l->next; } + swf_Shape2Free(s); + free(s); } static ALIGNZONE detect_for_char(SWFFONT * f, int nr, float*row, float*column, SRECT font_bbox, SRECT char_bbox) diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index bc0ff4f..62546db 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -354,7 +354,7 @@ int swf_FontExtract_DefineFont2(int id, SWFFONT * font, TAG * tag) // recalculate bounding box SHAPE2 *shape2 = swf_ShapeToShape2(font->glyph[t].shape); font->layout->bounds[t] = swf_GetShapeBoundingBox(shape2); - swf_Shape2Free(shape2); + swf_Shape2Free(shape2);free(shape2); } } @@ -844,7 +844,9 @@ int cmp_chars(const void*a, const void*b) { int x = *(const int*)a; int y = *(const int*)b; + return 0; } + void swf_FontSort(SWFFONT * font) { int i, j; @@ -1290,6 +1292,13 @@ int swf_TextPrintDefineText(TAG * t, SWFFONT * f) return 0; } +static void font_freealignzones(SWFFONT * f) +{ + if(f->alignzones) + free(f->alignzones); + f->alignzones = 0; +} + void swf_FontFree(SWFFONT * f) { int i; @@ -1325,6 +1334,7 @@ void swf_FontFree(SWFFONT * f) font_freelayout(f); font_freeglyphnames(f); font_freeusage(f); + font_freealignzones(f); rfx_free(f); } -- 1.7.10.4