From 268f657b2410bc6880c061e62f7ff8a42cc5817a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 16 Jul 2019 13:53:45 -0400 Subject: layout: Don't free no_break_attributes prematurely We use them in a loop. Don't free them before the loop is done. --- pango/pango-layout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index fb732d7d..e0725adc 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4241,10 +4241,7 @@ pango_layout_check_lines (PangoLayout *layout) iter); if (no_break_attrs) - { - apply_no_break_attributes (state.items, no_break_attrs); - pango_attr_list_unref (no_break_attrs); - } + apply_no_break_attributes (state.items, no_break_attrs); get_items_log_attrs (start, state.items, layout->log_attrs + start_offset, @@ -4297,6 +4294,9 @@ pango_layout_check_lines (PangoLayout *layout) pango_attr_iterator_destroy (iter); pango_attr_list_unref (attrs); + if (no_break_attrs) + pango_attr_list_unref (no_break_attrs); + if (no_shape_attrs) { apply_no_shape_attributes (layout, no_shape_attrs); -- cgit v1.2.1