[libdazzle] bolding: release allocated list when filtering



commit 2715f6ab1023f5d7524e192c10ce2c67367fe64b
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 26 23:48:45 2018 -0700

    bolding: release allocated list when filtering
    
    The filter function returns a newly allocated list that we are responsible
    to free.

 src/widgets/dzl-bolding-label.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/widgets/dzl-bolding-label.c b/src/widgets/dzl-bolding-label.c
index 4c2b43e..ba6259b 100644
--- a/src/widgets/dzl-bolding-label.c
+++ b/src/widgets/dzl-bolding-label.c
@@ -163,6 +163,7 @@ void
 dzl_bolding_label_set_weight (DzlBoldingLabel *self,
                               PangoWeight      weight)
 {
+  PangoAttrList *filtered;
   PangoAttrList *attrs;
   PangoAttrList *copy;
   PangoAttribute *attr;
@@ -175,10 +176,11 @@ dzl_bolding_label_set_weight (DzlBoldingLabel *self,
   else
     copy = pango_attr_list_new ();
   attr = pango_attr_weight_new (weight);
-  pango_attr_list_filter (copy, remove_weights, attr);
+  filtered = pango_attr_list_filter (copy, remove_weights, attr);
   pango_attr_list_insert (copy, attr);
   gtk_label_set_attributes (GTK_LABEL (self), copy);
   gtk_widget_queue_draw (GTK_WIDGET (self));
+  pango_attr_list_unref (filtered);
   pango_attr_list_unref (copy);
 }
 


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