[gtk+] scale: Don't leave css nodes behind
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scale: Don't leave css nodes behind
- Date: Tue, 1 Mar 2016 20:58:30 +0000 (UTC)
commit 577783a19db6f45deb732be6e24724c7cfeb28c0
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 1 15:57:36 2016 -0500
scale: Don't leave css nodes behind
We create and destroy gadgets inside the scale hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
gtk/gtkscale.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index ab49746..33e5199 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1869,8 +1869,12 @@ gtk_scale_mark_free (gpointer data)
{
GtkScaleMark *mark = data;
+ if (mark->label_gadget)
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (mark->label_gadget), NULL);
g_clear_object (&mark->label_gadget);
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (mark->indicator_gadget), NULL);
g_object_unref (mark->indicator_gadget);
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (mark->gadget), NULL);
g_object_unref (mark->gadget);
g_free (mark->markup);
g_free (mark);
@@ -1896,7 +1900,11 @@ gtk_scale_clear_marks (GtkScale *scale)
g_slist_free_full (priv->marks, gtk_scale_mark_free);
priv->marks = NULL;
+ if (priv->top_marks_gadget)
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->top_marks_gadget), NULL);
g_clear_object (&priv->top_marks_gadget);
+ if (priv->bottom_marks_gadget)
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->bottom_marks_gadget), NULL);
g_clear_object (&priv->bottom_marks_gadget);
_gtk_range_set_stop_values (GTK_RANGE (scale), NULL, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]