From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Tue, 16 Jan 2007 16:50:59 +0000 (+0100)
Subject: plug 2 pango memory leaks.
X-Git-Tag: release/2.11.12-1~20
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d1e789372cc76ed3b0791c4238517464309be094;p=lilypond.git

plug 2 pango memory leaks.
---

diff --git a/lily/pango-font.cc b/lily/pango-font.cc
index 75103e3b7b..adca7c5b70 100644
--- a/lily/pango-font.cc
+++ b/lily/pango-font.cc
@@ -104,7 +104,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str,
   char glyph_name[GLYPH_NAME_LEN];
   PangoAnalysis const *pa = &(item->analysis);
   PangoGlyphString *pgs = pango_glyph_string_new ();
-
+  
   pango_shape (str.c_str () + item->offset,
 	       item->length, (PangoAnalysis*) pa, pgs);
 
@@ -215,6 +215,8 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str,
       tail = SCM_CDRLOC (*tail);
     }
 
+  pango_glyph_string_free (pgs);  
+  pgs = 0;
   PangoFontDescription *descr = pango_font_describe (pa->font);
   Real size = pango_font_description_get_size (descr)
     / (Real (PANGO_SCALE));
@@ -363,6 +365,7 @@ Pango_font::text_stencil (string str, bool tight) const
       return Stencil (b, exp);
     }
 
+  g_list_free (items);
 
   return dest;
 }