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.
This commit is contained in:
Matthias Clasen
2016-03-01 15:35:32 -05:00
parent 87e71afd50
commit 37007c47a5

View File

@ -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;
}