gimp r26324 - in trunk: . app/text



Author: neo
Date: Sun Jul 27 20:51:16 2008
New Revision: 26324
URL: http://svn.gnome.org/viewvc/gimp?rev=26324&view=rev

Log:
2008-07-27  Sven Neumann  <sven gimp org>

	* app/text/gimptext-compat.c (text_get_extents): applied the 
same
	workaround for a memory leak in PangoFT2 (bug #143542) as was
	applied long ago in gimptextlayout.c.



Modified:
   trunk/ChangeLog
   trunk/app/text/gimptext-compat.c

Modified: trunk/app/text/gimptext-compat.c
==============================================================================
--- trunk/app/text/gimptext-compat.c	(original)
+++ trunk/app/text/gimptext-compat.c	Sun Jul 27 20:51:16 2008
@@ -154,6 +154,17 @@
   context = pango_ft2_font_map_create_context (PANGO_FT2_FONT_MAP (fontmap));
   g_object_unref (fontmap);
 
+  /*  Workaround for bug #143542 (PangoFT2Fontmap leak),
+   *  see also bug #148997 (Text layer rendering leaks font file descriptor):
+   *
+   *  Calling pango_ft2_font_map_substitute_changed() causes the
+   *  font_map cache to be flushed, thereby removing the circular
+   *  reference that causes the leak.
+   */
+  g_object_weak_ref (G_OBJECT (context),
+                     (GWeakNotify) pango_ft2_font_map_substitute_changed,
+                     fontmap);
+
   layout = pango_layout_new (context);
   g_object_unref (context);
 



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