freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] xine-lib leaking memory (lot's) with freetype


From: Masatake YAMATO
Subject: Re: [ft-devel] xine-lib leaking memory (lot's) with freetype
Date: Mon, 26 Feb 2007 20:30:28 +0900 (JST)

> What I found in the end was that if xine-lib is compiled with freetype
> support enabled every time FT_Init_FreeType is called (and fails) in
> osd.c freetype mallocs some memory that is not freed. 

You may be right.
Could you try following patch?

2007-02-26  Masatake YAMATO  <address@hidden>

        * src/base/ftinit.c(FT_Init_FreeType): free `memory'
        if FT_New_Library returns an error. Bug reported by 
        Maximilian Schwerin <address@hidden>.

--- ftinit.c    20  1月 2006 03:33:50 +0900      1.38
+++ ftinit.c    26  2月 2007 20:24:11 +0900      
@@ -124,15 +124,19 @@
     /* default drivers.                                        */
 
     error = FT_New_Library( memory, alibrary );
-    if ( !error )
+    if ( error )
     {
-      (*alibrary)->version_major = FREETYPE_MAJOR;
-      (*alibrary)->version_minor = FREETYPE_MINOR;
-      (*alibrary)->version_patch = FREETYPE_PATCH;
-
-      FT_Add_Default_Modules( *alibrary );
+      FT_FREE(memory);
+      goto Exit;
     }
 
+    (*alibrary)->version_major = FREETYPE_MAJOR;
+    (*alibrary)->version_minor = FREETYPE_MINOR;
+    (*alibrary)->version_patch = FREETYPE_PATCH;
+
+    FT_Add_Default_Modules( *alibrary );      
+
+  Exit:
     return error;
   }
 




reply via email to

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