# HG changeset patch # User eugeni # Date 1177152988 0 # Node ID e8afcfccf35963a6ac9ed446abf5242a62b324f0 # Parent 82697eb7803dd508da5265a9bec0f0c76a836da3 Always deallocate glyphs. Fixes a memory leak. diff -r 82697eb7803d -r e8afcfccf359 libass/ass_render.c --- a/libass/ass_render.c Sat Apr 21 10:43:19 2007 +0000 +++ b/libass/ass_render.c Sat Apr 21 10:56:28 2007 +0000 @@ -402,9 +402,6 @@ &text_info->glyphs[i].bm_s, text_info->glyphs[i].be); if (error) text_info->glyphs[i].symbol = 0; - FT_Done_Glyph(text_info->glyphs[i].glyph); - if (text_info->glyphs[i].outline_glyph) - FT_Done_Glyph(text_info->glyphs[i].outline_glyph); // cache hash_val.bm_o = text_info->glyphs[i].bm_o; @@ -412,6 +409,10 @@ hash_val.bm_s = text_info->glyphs[i].bm_s; cache_add_bitmap(&(text_info->glyphs[i].hash_key), &hash_val); } + if (text_info->glyphs[i].glyph) + FT_Done_Glyph(text_info->glyphs[i].glyph); + if (text_info->glyphs[i].outline_glyph) + FT_Done_Glyph(text_info->glyphs[i].outline_glyph); } for (i = 0; i < text_info->length; ++i) {