changeset 26478:6f22d0c91beb stable

Fix memory leak with FT_Glyph objects (bug #55287) * ft-text-renderer.cc (ft_text_renderer::process_character): Call FT_Done_Glyph after we are done with a loaded glyph. (ft_text_renderer::ft_text_renderer): Initialize line_xoffset as per PVS analyzer notice.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 07 Jan 2019 09:40:17 +0100
parents 310143b2c2c4
children 11cef718fcbc 4203f6e0cd7d
files libinterp/corefcn/ft-text-renderer.cc
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/ft-text-renderer.cc	Sun Jan 06 21:59:20 2019 -0800
+++ b/libinterp/corefcn/ft-text-renderer.cc	Mon Jan 07 09:40:17 2019 +0100
@@ -376,8 +376,8 @@
     ft_text_renderer (void)
       : base_text_renderer (), font (), bbox (1, 4, 0.0), halign (0),
         xoffset (0), line_yoffset (0), yoffset (0), mode (MODE_BBOX),
-        color (dim_vector (1, 3), 0), m_ymin (0), m_ymax (0), m_deltax (0),
-        m_max_fontsize (0)
+        color (dim_vector (1, 3), 0), line_xoffset (0), m_ymin (0), m_ymax (0),
+        m_deltax (0), m_max_fontsize (0)
     { }
 
     // No copying!
@@ -840,6 +840,7 @@
                                         m_ymin);
                     m_ymax = math::max ((glyph_bbox.yMax >> 6) + yoffset,
                                         m_ymax);
+                    FT_Done_Glyph (glyph);
                     update_line_bbox ();
                   }
                 break;