[pango/line-breaker] line-breaker: Fix a corner case



commit ee9591c7a5b9abd7b2593d5a5fd116b2b64f88c9
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 25 21:21:39 2022 -0500

    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;
     }
 


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