freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] patch to fix memory leak with .pcf.gz files


From: David Turner
Subject: Re: [Devel] patch to fix memory leak with .pcf.gz files
Date: Fri, 28 Feb 2003 09:32:46 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210

Hello,

Pixel wrote:
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 :)


thanks, I've applied the fix to the CVS this morning.

Best Regards,

- David Turner
- The FreeType Project  (www.freetype.org)



------------------------------------------------------------------------

--- 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]