[gtk+] label: Don't leak clip regions
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] label: Don't leak clip regions
- Date: Fri, 1 Sep 2017 19:34:22 +0000 (UTC)
commit 6bdebd157048678a0b067e1492cff3ac0717e35d
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 1 15:32:48 2017 -0400
label: Don't leak clip regions
This was introduced in the conversion to gsk.
gtk/gtklabel.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 4f87501..a54fa29 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3948,11 +3948,14 @@ gtk_label_snapshot (GtkWidget *widget,
range_clip = gdk_pango_layout_get_clip_region (priv->layout, lx, ly, range, 1);
cairo_region_get_extents (range_clip, &clip_extents);
+
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_extents), "Selected Text");
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
gtk_snapshot_pop (snapshot);
+ cairo_region_destroy (range_clip);
+
gtk_style_context_restore (context);
}
else if (info)
@@ -3995,6 +3998,8 @@ gtk_label_snapshot (GtkWidget *widget,
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
gtk_snapshot_pop (snapshot);
+ cairo_region_destroy (range_clip);
+
gtk_style_context_restore (context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]