diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 17 | ||||
-rw-r--r-- | src/ephy-history-model.c | 13 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 2432846e3..a4f5412a4 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -174,6 +174,7 @@ ephy_bookmarks_clean_empty_keywords (EphyBookmarks *eb) { GPtrArray *children; int i; + GList *l = NULL, *tmp; children = ephy_node_get_children (eb->priv->keywords); ephy_node_thaw (eb->priv->keywords); @@ -185,13 +186,21 @@ ephy_bookmarks_clean_empty_keywords (EphyBookmarks *eb) if (ephy_node_get_n_children (kid) == 0) { - DEBUG_MSG (("Remove empty keyword: %s\n", - ephy_node_get_property_string (kid, - EPHY_NODE_KEYWORD_PROP_NAME))); - ephy_node_unref (kid); + l = g_list_append (l, kid); } } + if (l == NULL) return FALSE; + + for (tmp = l; tmp != NULL; tmp = tmp->next) + { + DEBUG_MSG (("Remove empty keyword: %s\n", + ephy_node_get_property_string (kid, + EPHY_NODE_KEYWORD_PROP_NAME))); + g_object_unref (EPHY_NODE (tmp->data)); + } + g_list_free (l); + return FALSE; } diff --git a/src/ephy-history-model.c b/src/ephy-history-model.c index c4e694bcd..baa948a7d 100644 --- a/src/ephy-history-model.c +++ b/src/ephy-history-model.c @@ -476,6 +476,7 @@ get_one_level_path_real (EphyHistoryModel *model, retval = gtk_tree_path_new (); my_parent = get_parent_node (model, node); + g_return_val_if_fail (my_parent != NULL, NULL); gtk_tree_path_append_index (retval, ephy_node_get_child_index (my_parent, node)); @@ -489,8 +490,10 @@ get_path_real (EphyHistoryModel *model, GtkTreePath *retval; EphyNode *host; - retval = gtk_tree_path_new (); host = get_parent_node (model, page); + if (host != NULL) return NULL; + + retval = gtk_tree_path_new (); gtk_tree_path_append_index (retval, ephy_node_get_child_index (model->priv->root, host)); gtk_tree_path_append_index (retval, ephy_node_get_child_index (host, page)); @@ -776,8 +779,12 @@ root_child_removed_cb (EphyNode *node, { path = get_path_real (model, child); } - gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path); - gtk_tree_path_free (path); + + if (path) + { + gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path); + gtk_tree_path_free (path); + } } static void |