[pango/better-hyphens] layout: Don't free no_break_attributes prematurely



commit 19127ab8870efc1a44c74a54f131ae76f2f21e04
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 16 13:53:45 2019 -0400

    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 c6ce6472..a3657068 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4242,10 +4242,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,
@@ -4298,6 +4295,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);


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