[dia/dia-0-97] Bug #581380 - memory leak with libart renderer



commit 789e022e7eee46e4235b81f79b66a4dcbe6a866f
Author: Hans Breuer <hans breuer org>
Date:   Sun Jul 5 11:26:43 2009 +0200

    Bug #581380 - memory leak with libart renderer
    
    Patch from Jason Childs. The deprecated dia_font_push_context()/
    dia_font_pop_context() had a superfluous call to dia_font_init()
    "not needed, just testing" which resulted in a fast growing
    memory leak, when using the almost deprecated libart renderer.

 lib/font.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/font.c b/lib/font.c
index 2b9e94f..1846145 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -83,8 +83,9 @@ dia_font_check_for_font(int font)
   if (!loaded) {
     message_error(_("Can't load font %s.\n"), dia_font_get_family(check));
   } else {
-    g_object_unref (loaded);
+    g_object_unref(loaded);
   }
+  dia_font_unref(check);
 }
 
 void
@@ -104,7 +105,6 @@ static GList *pango_contexts = NULL;
 void
 dia_font_push_context(PangoContext *pcontext) 
 {
-  dia_font_init (pcontext); /* not needed, just testing */
   pango_contexts = g_list_prepend(pango_contexts, pango_context);
   pango_context = pcontext;
   pango_context_set_language (pango_context, gtk_get_default_language ());



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