[vte/vte-next] _vte_draw_set_text_font(): fix PangoContext leak if font_info in cache



commit 563eb46ceaab9b547f3c3ebb091f148ab1186733
Author: Pavel Vasin <rat4vier gmail com>
Date:   Sat Mar 24 19:08:35 2012 +0400

    _vte_draw_set_text_font(): fix PangoContext leak if font_info in cache
    
    Bug #672757.

 src/vtedraw.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/vtedraw.c b/src/vtedraw.c
index b8f0777..d997f91 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -569,13 +569,13 @@ font_info_find_for_context (PangoContext *context)
 		_vte_debug_print (VTE_DEBUG_PANGOCAIRO,
 				  "vtepangocairo: %p found font_info in cache\n",
 				  info);
-		return font_info_reference (info);
+		info = font_info_reference (info);
+	} else {
+		info = font_info_allocate (context);
+		info->ref_count = 1;
+		font_info_register (info);
 	}
 
-	info = font_info_allocate (context);
-	info->ref_count = 1;
-	font_info_register (info);
-
 	g_object_unref (context);
 
 	return info;



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