From 164039083913e84de2da383da10b6126dba318d3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Aug 2022 20:01:34 -0400 Subject: [PATCH 1/2] inscription: Plug a memory leak PangoLayoutIter needs to be freed. --- gtk/gtkinscription.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index 4dfa8e5eb3..edad5f7ac9 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -490,6 +490,7 @@ gtk_inscription_allocate (GtkWidget *widget, } } } + pango_layout_iter_free (iter); } break; From 33cf8f9404666f1eb2e9522ef12ca0ecd41e0108 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Aug 2022 20:02:58 -0400 Subject: [PATCH 2/2] inscription: Plug a memory leak PangoFontMetrics also need to be freed. --- gtk/gtkinscription.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index edad5f7ac9..7ce22702eb 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -344,9 +344,9 @@ get_line_pixels (GtkInscription *self, int ascent, descent; metrics = gtk_inscription_get_font_metrics (self); - ascent = pango_font_metrics_get_ascent (metrics); descent = pango_font_metrics_get_descent (metrics); + pango_font_metrics_unref (metrics); if (baseline) *baseline = ascent;