aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/widgets/ephy-toolbars-group.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/widgets/ephy-toolbars-group.c b/lib/widgets/ephy-toolbars-group.c
index 3711efe2d..da8ef8f38 100755
--- a/lib/widgets/ephy-toolbars-group.c
+++ b/lib/widgets/ephy-toolbars-group.c
@@ -511,15 +511,23 @@ ephy_toolbars_group_remove_item (EphyToolbarsGroup *t,
EphyToolbarsItem *item)
{
GNode *node;
+ GNode *toolbar;
g_return_if_fail (IS_EPHY_TOOLBARS_GROUP (t));
g_return_if_fail (item != NULL);
node = g_node_find (t->priv->toolbars, G_IN_ORDER, G_TRAVERSE_ALL, item);
g_return_if_fail (node != NULL);
+ toolbar = node->parent;
free_toolbar_node (node->data);
g_node_destroy (node);
+ if (g_node_n_children (toolbar) == 0)
+ {
+ free_toolbar_node (toolbar->data);
+ g_node_destroy (toolbar);
+ }
+
toolbars_group_save (t);
g_signal_emit (G_OBJECT (t), ephy_toolbars_group_signals[CHANGED], 0);