From 9cb522ce38b54156380edff162e32f36e3e9a20c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 8 Feb 2016 14:59:35 +0000 Subject: [PATCH] Don't haemorrhage Pango layouts out of nsfont_paint. Before: LEAK SUMMARY: definitely lost: 143,462 bytes in 811 blocks indirectly lost: 835,174 bytes in 16,656 blocks possibly lost: 104,465 bytes in 1,631 blocks still reachable: 3,634,180 bytes in 30,844 blocks suppressed: 0 bytes in 0 blocks After: LEAK SUMMARY: definitely lost: 57,990 bytes in 258 blocks indirectly lost: 218,013 bytes in 5,995 blocks possibly lost: 110,118 bytes in 1,837 blocks still reachable: 3,637,842 bytes in 30,881 blocks suppressed: 0 bytes in 0 blocks --- gtk/font_pango.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/font_pango.c b/gtk/font_pango.c index c1bddd89d..e83619ad8 100644 --- a/gtk/font_pango.c +++ b/gtk/font_pango.c @@ -250,6 +250,7 @@ bool nsfont_paint(int x, int y, const char *string, size_t length, nsgtk_set_colour(fstyle->foreground); pango_cairo_show_layout_line(current_cr, line); + g_object_unref(layout); pango_font_description_free(desc); return true;