From: kramm Date: Fri, 26 Oct 2007 14:39:18 +0000 (+0000) Subject: added parameter to gfxfontlist_free() X-Git-Tag: buttons-working~503 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=3d0dfb65e6fdb0bd5b0d0e10dd70495fcbcbd75d;p=swftools.git added parameter to gfxfontlist_free() --- diff --git a/lib/gfxtools.c b/lib/gfxtools.c index dd6b9ad..dd8d2b7 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -25,6 +25,7 @@ #include #include #include "gfxtools.h" +#include "gfxfont.h" typedef struct _linedraw_internal { @@ -772,12 +773,15 @@ gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font) return l; } } -void gfxfontlist_free(gfxfontlist_t*list) +void gfxfontlist_free(gfxfontlist_t*list, char deletefonts) { gfxfontlist_t*l = list; while(l) { gfxfontlist_t*next = l; memset(l, 0, sizeof(*l)); + if(l->font) { + gfxfont_free(l->font); + } free(l); l = next; } diff --git a/lib/gfxtools.h b/lib/gfxtools.h index b0f9ce8..d88b98f 100644 --- a/lib/gfxtools.h +++ b/lib/gfxtools.h @@ -81,7 +81,7 @@ gfxfontlist_t* gfxfontlist_create(); gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font); gfxfont_t*gfxfontlist_findfont(gfxfontlist_t*list, char*id); char gfxfontlist_hasfont(gfxfontlist_t*list, gfxfont_t*font); -void gfxfontlist_free(gfxfontlist_t*list); +void gfxfontlist_free(gfxfontlist_t*list, char deletefonts); gfxline_t*gfxline_makerectangle(int x1, int y1, int x2, int y2); void gfxline_show(gfxline_t*line, FILE*fi);