aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-19 21:29:46 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-19 21:29:46 +0800
commit89f824edb461ffa185ca78962f39f582919544f4 (patch)
tree7f9f062d10397f7d3abb613eaa5fa78179cb9e1d
parent4e2ac65da1cf8ac42f4dbbbb1f7fe3e021433565 (diff)
downloadgsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar.gz
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar.bz2
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar.lz
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar.xz
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.tar.zst
gsoc2013-epiphany-89f824edb461ffa185ca78962f39f582919544f4.zip
We cant remove while iterating childrens, build a list and remove later.
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.
-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;