diff options
author | steven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-02-09 04:15:49 +0000 |
---|---|---|
committer | steven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-02-09 04:15:49 +0000 |
commit | 411521259833f9742ea6273c65897f10ca398ee0 (patch) | |
tree | d2469357bc52a570079bae6a3e3dfc29a9f0795c /navit/font | |
parent | 8b89d5fa37b4f4c1a55148e81ad6af8a5cbf7be4 (diff) | |
download | navit-411521259833f9742ea6273c65897f10ca398ee0.tar.gz |
Fix:font_freetype: Deallocate the glyph after we are done using it|valgrind memory warning
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2031 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/font')
-rw-r--r-- | navit/font/freetype/font_freetype.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/navit/font/freetype/font_freetype.c b/navit/font/freetype/font_freetype.c index ca94da137..20f10522b 100644 --- a/navit/font/freetype/font_freetype.c +++ b/navit/font/freetype/font_freetype.c @@ -116,12 +116,7 @@ font_freetype_get_text_bbox(struct graphics_priv *gr, FT_Get_Glyph(font->face->glyph, &glyph); #endif FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_pixels, &glyph_bbox); -#if USE_CACHING - FT_Done_Glyph(glyph); - FTC_Node_Unref(anode, manager); -#else - FT_Done_Glyph(glyph); -#endif + glyph_bbox.xMin += x >> 6; glyph_bbox.xMax += x >> 6; glyph_bbox.yMin += y >> 6; @@ -137,6 +132,12 @@ font_freetype_get_text_bbox(struct graphics_priv *gr, if (glyph_bbox.yMax > bbox.yMax) bbox.yMax = glyph_bbox.yMax; p = g_utf8_next_char(p); +#if USE_CACHING + FT_Done_Glyph(glyph); + FTC_Node_Unref(anode, manager); +#else + FT_Done_Glyph(glyph); +#endif } if (bbox.xMin > bbox.xMax) { bbox.xMin = 0; |