diff -rup poppler-0.6.4.orig/poppler/CairoFontEngine.cc poppler-0.6.4/poppler/CairoFontEngine.cc --- poppler-0.6.4.orig/poppler/CairoFontEngine.cc 2008-01-22 06:30:59.000000000 +1030 +++ poppler-0.6.4/poppler/CairoFontEngine.cc 2008-06-15 21:16:08.000000000 +0930 @@ -31,11 +31,10 @@ static void fileWrite(void *stream, char // CairoFont //------------------------------------------------------------------------ -static void cairo_font_face_destroy (void *data) +static void _ft_done_face (void *data) { - CairoFont *font = (CairoFont *) data; - - delete font; + FT_Face face = (FT_Face) data; + FT_Done_Face (face); } CairoFont *CairoFont::create(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs) { @@ -223,16 +222,16 @@ CairoFont *CairoFont::create(GfxFont *gf cairo_font_face = cairo_ft_font_face_create_for_ft_face (face, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); - if (cairo_font_face == NULL) { - error(-1, "could not create cairo font\n"); + if (cairo_font_face_status (cairo_font_face)) { + error(-1, "could not create cairo font: %s\n", cairo_status_to_string (cairo_font_face_status (cairo_font_face))); goto err2; /* this doesn't do anything, but it looks like we're * handling the error */ } { CairoFont *ret = new CairoFont(ref, cairo_font_face, face, codeToGID, codeToGIDLen); - cairo_font_face_set_user_data (cairo_font_face, - &cairo_font_face_key, - ret, - cairo_font_face_destroy); + cairo_font_face_set_user_data (cairo_font_face, + &cairo_font_face_key, + face, + _ft_done_face); return ret; } @@ -248,7 +247,7 @@ CairoFont::CairoFont(Ref ref, cairo_font codeToGIDLen(codeToGIDLen) { } CairoFont::~CairoFont() { - FT_Done_Face (face); + cairo_font_face_destroy (cairo_font_face); gfree(codeToGID); }