[pangomm] GlyphItem: Fix a memory leak in split()



commit 4b04af5b466dbc7a9da1c35b03e62a06914965e1
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat Jan 16 13:06:15 2021 +0100

    GlyphItem: Fix a memory leak in split()

 pango/src/glyphitem.hg | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/pango/src/glyphitem.hg b/pango/src/glyphitem.hg
index 3c6353c..12ce884 100644
--- a/pango/src/glyphitem.hg
+++ b/pango/src/glyphitem.hg
@@ -45,6 +45,8 @@ class PANGOMM_API GlyphItem
   _CLASS_BOXEDTYPE(GlyphItem, PangoGlyphItem, NONE, pango_glyph_item_copy, pango_glyph_item_free, 
PANGOMM_API)
   _IGNORE(pango_glyph_item_free, pango_glyph_item_copy)
 
+  // pango_glyph_item_split() returns a newly created PangoGlyphItem. Don't take a copy.
+#m4 _CONVERSION(`PangoGlyphItem*',`GlyphItem',`Glib::wrap($3)')
   _WRAP_METHOD(GlyphItem split(const Glib::ustring& text, int split_index), pango_glyph_item_split)
 
   //This takes ownership of the GlyphItem, which is strange:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]