aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--embed/ephy-history.c22
2 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 596cedcc7..f9f1676da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-10-19 Marco Pesenti Gritti <marco@gnome.org>
+
+ * embed/ephy-history.c: (update_host_on_child_remove),
+ (update_hosts):
+
+ We cant remove while iterating childrens, build a list
+ and remove later.
+
2003-10-19 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-location-action.c: (init_actions_list):
diff --git a/embed/ephy-history.c b/embed/ephy-history.c
index d3991bea6..197ad85d3 100644
--- a/embed/ephy-history.c
+++ b/embed/ephy-history.c
@@ -289,12 +289,6 @@ update_host_on_child_remove (EphyNode *node)
GPtrArray *children;
int i, host_last_visit, new_host_last_visit = 0;
- if (ephy_node_get_n_children (node) == 0)
- {
- ephy_node_unref (node);
- return;
- }
-
host_last_visit = ephy_node_get_property_int
(node, EPHY_NODE_PAGE_PROP_LAST_VISIT);
@@ -333,19 +327,31 @@ update_hosts (EphyHistory *eh)
{
GPtrArray *children;
int i;
+ GList *empty = NULL;
children = ephy_node_get_children (eh->priv->hosts);
- ephy_node_thaw (eh->priv->hosts);
for (i = 0; i < children->len; i++)
{
EphyNode *kid;
kid = g_ptr_array_index (children, i);
+
if (kid != eh->priv->pages)
{
- update_host_on_child_remove (kid);
+ if (ephy_node_get_n_children (kid) > 0)
+ {
+ update_host_on_child_remove (kid);
+ }
+ else
+ {
+ empty = g_list_prepend (empty, kid);
+ }
}
}
+ ephy_node_thaw (eh->priv->hosts);
+
+ g_list_foreach (empty, (GFunc)ephy_node_unref, NULL);
+ g_list_free (empty);
eh->priv->update_hosts_idle = 0;