Problem encountered with "fc-cache -f" using more than 100MB of memory
when scanning /usr/lib/X11/fonts/75dpi + /usr/lib/X11/fonts/100dpi
ft-test-leak.c shows the problem (needs a .pcf.gz font) when setting
FT_DEBUG_MEMORY:
FreeType.Debug: FreeType: 44376 bytes of memory leaked in 4 blocks
Simple fix included (i'm no zlib nor freetype guru, but it seems the
right thing to do :)
------------------------------------------------------------------------
--- freetype-2.1.3/src/gzip/ftgzip.c.pix 2003-02-24 23:23:58.000000000
+0100
+++ freetype-2.1.3/src/gzip/ftgzip.c 2003-02-24 23:26:22.000000000 +0100
@@ -276,6 +276,8 @@
{
z_stream* zstream = &zip->zstream;
+ inflateEnd(zstream);
+
/* clear the rest */
zstream->zalloc = NULL;
zstream->zfree = NULL;
------------------------------------------------------------------------
#include <freetype/freetype.h>
int main()
{
FT_Library library = NULL;
FT_Face face;
FT_Init_FreeType(&library);
FT_New_Face(library, "/tmp/charB18.pcf.gz", 0, &face);
FT_Done_Face(face);
FT_Done_FreeType(library);
}
------------------------------------------------------------------------
cu