[libdazzle/libdazzle-3-28] bolding: release allocated list when filtering
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle/libdazzle-3-28] bolding: release allocated list when filtering
- Date: Wed, 27 Jun 2018 06:50:15 +0000 (UTC)
commit 33966984661446f6efc21514b589afce9a2ec2a6
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 374835d..2dc41b3 100644
--- a/src/widgets/dzl-bolding-label.c
+++ b/src/widgets/dzl-bolding-label.c
@@ -158,6 +158,7 @@ void
dzl_bolding_label_set_weight (DzlBoldingLabel *self,
PangoWeight weight)
{
+ PangoAttrList *filtered;
PangoAttrList *attrs;
PangoAttrList *copy;
PangoAttribute *attr;
@@ -170,10 +171,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]