From 1b86d0b5362a7b3f317b85696f9fc35d8bc0e7c4 Mon Sep 17 00:00:00 2001 From: Maximilian Schwerin Date: Mon, 3 Nov 2008 16:06:15 +0100 Subject: Free up resources when we finish with a Freetype font. --- src/xine-engine/osd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index f8cbfefb2..af8286831 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -125,6 +125,8 @@ struct osd_ft2context_s { static void osd_free_ft2 (osd_object_t *osd) { if( osd->ft2 ) { + if ( osd->ft2->face ) + FT_Done_Face (osd->ft2->face); if ( osd->ft2->library ) FT_Done_FreeType(osd->ft2->library); free( osd->ft2 ); @@ -828,6 +830,11 @@ static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int return 0; } } + + if (osd->ft2->face) { + FT_Done_Face (osd->ft2->face); + osd->ft2->face = NULL; + } #ifdef HAVE_FONTCONFIG do { -- cgit v1.2.3