[gtk+] level bar: Don't leave css nodes behind
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] level bar: Don't leave css nodes behind
- Date: Tue, 1 Mar 2016 20:36:29 +0000 (UTC)
commit 37007c47a55cae23c120040fb6a2f9199481b14d
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Mar 1 15:35:32 2016 -0500
level bar: Don't leave css nodes behind
We create and destroy gadgets inside the levelbar hierarchy here,
and if we don't explicitly remove their CSS nodes from the parent,
they stick around.
gtk/gtklevelbar.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 99317dc..d293661 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -586,7 +586,10 @@ update_block_nodes (GtkLevelBar *self)
else if (n_blocks < priv->n_blocks)
{
for (i = n_blocks; i < priv->n_blocks; i++)
- g_clear_object (&priv->block_gadget[i]);
+ {
+ gtk_css_node_set_parent (gtk_css_gadget_get_node (priv->block_gadget[i]), NULL);
+ g_clear_object (&priv->block_gadget[i]);
+ }
priv->block_gadget = g_renew (GtkCssGadget*, priv->block_gadget, n_blocks);
priv->n_blocks = n_blocks;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]