From 175d85d6d7c3976ab7fe616332040ae0fdce2201 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 25 Jan 2022 21:21:39 -0500 Subject: line-breaker: Fix a corner case We were sometimes leaving a stray glyphstring behind when handling newlines in single paragraph mode. --- pango/pango-line-breaker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pango/pango-line-breaker.c b/pango/pango-line-breaker.c index 05c905aa..90fe81bc 100644 --- a/pango/pango-line-breaker.c +++ b/pango/pango-line-breaker.c @@ -1116,6 +1116,7 @@ compute_log_widths (PangoLineBreaker *self) self->num_log_widths = item->num_chars; } + g_assert (self->log_widths_offset == 0); pango_glyph_item_get_logical_widths (&glyph_item, self->data->text, self->log_widths); } @@ -1244,6 +1245,7 @@ process_item (PangoLineBreaker *self, if (item_is_paragraph_separator (self, item)) { + g_clear_pointer (&self->glyphs, pango_glyph_string_free); return BREAK_PARAGRAPH_SEPARATOR; } -- cgit v1.2.1