formatting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/ChangeLog b/ChangeLog
index 1f3a3d3..d22ba17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,26 @@
2006-06-06 David Turner <david@freetype.org>
- * include/freetype/internal/services/svpscmap.h, src/cff/cffcmap.c,
- src/psaux/t1cmap.c, src/psnames/psmodule.c: Fix for the memory
- leak described in bug #16759.
+ Fix memory leak described in Savannah bug #16759.
- We change 'ps_unicodes_init' so that it also takes a 'free_glyph_name'
- callback to release the glyph names returned by 'get_glyph_name'
+ We change `ps_unicodes_init' so that it also takes a
+ `free_glyph_name' callback to release the glyph names returned by
+ `get_glyph_name'
+
+ * include/freetype/internal/services/svpscmap.h (PS_Glyph_NameFunc):
+ Renamed to ...
+ (PS_GetGlyphNameFunc): This.
+ (PS_FreeGlyphNameFunc): New typedef.
+ (PS_Unicodes_InitFunc): Add variable for PS_FreeGlyphNameFunc.
+
+ * src/cff/cffcmap.c (cff_sid_to_glyph_name): Use `TT_Face' for first
+ argument.
+ (cff_sid_free_glyph_name): New function.
+ (cff_cmap_unicode_init): Updated.
+
+ * src/psaux/t1cmap.c (t1_cmap_unicode_init): Updated.
+
+ * src/psnames/psmodule.c (ps_unicodes_init): Add variable for
+ PS_FreeGlyphNameFunc and use it.
2006-06-04 David Turner <david@freetype.org>
@@ -228,7 +243,7 @@
Updated.
* builds/unix/install-sh: Updated from `texinfo' CVS module at
- Savannah.gnu.org.
+ savannah.gnu.org.
* devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.
@@ -1513,7 +1528,7 @@
2006-01-22 Werner Lemberg <wl@gnu.org>
* builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `texinfo' CVS module at Savannah.gnu.org.
+ `texinfo' CVS module at savannah.gnu.org.
2006-01-21 Werner Lemberg <wl@gnu.org>
diff --git a/src/cff/cffcmap.c b/src/cff/cffcmap.c
index ea703cf..44d8a17 100644
--- a/src/cff/cffcmap.c
+++ b/src/cff/cffcmap.c
@@ -123,7 +123,7 @@
cff_sid_to_glyph_name( TT_Face face,
FT_UInt idx )
{
- CFF_Font cff = (CFF_Font) face->extra.data;
+ CFF_Font cff = (CFF_Font)face->extra.data;
CFF_Charset charset = &cff->charset;
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
FT_UInt sid = charset->sids[idx];
@@ -132,12 +132,14 @@
return cff_index_get_sid_string( &cff->string_index, sid, psnames );
}
+
FT_CALLBACK_DEF( void )
cff_sid_free_glyph_name( TT_Face face,
const char* gname )
{
FT_Memory memory = FT_FACE_MEMORY( face );
+
FT_FREE( gname );
}
@@ -159,8 +161,8 @@
return psnames->unicodes_init( memory,
unicodes,
cff->num_glyphs,
- (PS_GetGlyphNameFunc) &cff_sid_to_glyph_name,
- (PS_FreeGlyphNameFunc) &cff_sid_free_glyph_name,
+ (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name,
+ (PS_FreeGlyphNameFunc)&cff_sid_free_glyph_name,
(FT_Pointer)cff );
}
diff --git a/src/psaux/t1cmap.c b/src/psaux/t1cmap.c
index 772f441..2934686 100644
--- a/src/psaux/t1cmap.c
+++ b/src/psaux/t1cmap.c
@@ -276,8 +276,8 @@
return psnames->unicodes_init( memory,
unicodes,
face->type1.num_glyphs,
- (PS_GetGlyphNameFunc) &t1_get_glyph_name,
- (PS_FreeGlyphNameFunc) NULL,
+ (PS_GetGlyphNameFunc)&t1_get_glyph_name,
+ (PS_FreeGlyphNameFunc)NULL,
(FT_Pointer)face );
}