revision 1.12 date: 2001/03/06 13:55:38; author: werner; state: Exp; lines: +0 -3 Fixed a memory leak: The pointer to the MarkAttachClassDef table (loaded in ftxgpos.c and ftxgsub.c on demand) wasn't copied to the extension structure which takes care of deallocation. Index: ftxgpos.c =================================================================== RCS file: /cvs/freetype/freetype/lib/extend/ftxgpos.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -p -r1.9 -r1.10 --- ftxgpos.c 2001/03/05 21:07:50 1.9 +++ ftxgpos.c 2001/03/06 13:55:38 1.10 @@ -172,6 +169,7 @@ UShort i, num_lookups; TTO_GPOSHeader* gpos; + TTO_GDEFHeader* gdef_reg; TTO_Lookup* lo; PFace faze = HANDLE_Face( face ); @@ -280,6 +278,14 @@ ( error = Load_ClassDefinition( &gdef->MarkAttachClassDef, 256, faze ) ) != TT_Err_Ok ) goto Fail1; + + /* copy the class definition pointer into the extension structure */ + + error = TT_Extension_Get( faze, GDEF_ID, (void**)&gdef_reg ); + if ( error ) + return error; + + *gdef_reg = *gdef; break; } Index: ftxgsub.c =================================================================== RCS file: /cvs/freetype/freetype/lib/extend/ftxgsub.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -p -r1.38 -r1.39 --- ftxgsub.c 2001/03/05 21:07:50 1.38 +++ ftxgsub.c 2001/03/06 13:55:38 1.39 @@ -252,6 +249,7 @@ UShort i, num_lookups; TTO_GSUBHeader* gsub; + TTO_GDEFHeader* gdef_reg; TTO_Lookup* lo; PFace faze = HANDLE_Face( face ); @@ -360,6 +358,14 @@ ( error = Load_ClassDefinition( &gdef->MarkAttachClassDef, 256, faze ) ) != TT_Err_Ok ) goto Fail1; + + /* copy the class definition pointer into the extension structure */ + + error = TT_Extension_Get( faze, GDEF_ID, (void**)&gdef_reg ); + if ( error ) + return error; + + *gdef_reg = *gdef; break; }