From: kramm Date: Sat, 20 Oct 2007 17:14:10 +0000 (+0000) Subject: added gfxfontlist_free X-Git-Tag: buttons-working~521 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=cb7a8d34e7e1163897e5c11e36f805ced9bba5dc;p=swftools.git added gfxfontlist_free --- diff --git a/lib/gfxtools.c b/lib/gfxtools.c index eeb1a7a..dd6b9ad 100644 --- a/lib/gfxtools.c +++ b/lib/gfxtools.c @@ -772,6 +772,16 @@ gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font) return l; } } +void gfxfontlist_free(gfxfontlist_t*list) +{ + gfxfontlist_t*l = list; + while(l) { + gfxfontlist_t*next = l; + memset(l, 0, sizeof(*l)); + free(l); + l = next; + } +} gfxline_t*gfxline_makerectangle(int x1,int y1,int x2, int y2) { diff --git a/lib/gfxtools.h b/lib/gfxtools.h index f24faee..b0f9ce8 100644 --- a/lib/gfxtools.h +++ b/lib/gfxtools.h @@ -81,6 +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); gfxline_t*gfxline_makerectangle(int x1, int y1, int x2, int y2); void gfxline_show(gfxline_t*line, FILE*fi);