aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-07-27 20:26:10 +0800
committerChristian Persch <chpe@src.gnome.org>2003-07-27 20:26:10 +0800
commite9f8e15bf4f624f566eb0ea66e47be67098d5dc2 (patch)
treef20794535a04f1fa880f64672c6f7cb926468f40
parent0146bc5753236a6a0ae2037a8eba414780fa155b (diff)
downloadgsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar.gz
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar.bz2
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar.lz
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar.xz
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.tar.zst
gsoc2013-epiphany-e9f8e15bf4f624f566eb0ea66e47be67098d5dc2.zip
Fix mem leak.
2003-07-27 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/ephy-node-view.c: (ephy_node_view_remove): Fix mem leak. * lib/widgets/ephy-node-view.c: (ephy_node_view_remove): * src/pdm-dialog.c: (pdm_cmd_delete_selection): If we've just deleted every row in the tree view, the row ref contains an empty path. Check for that; possibly fixing bug #118398.
-rw-r--r--ChangeLog12
-rw-r--r--lib/widgets/ephy-node-view.c15
-rwxr-xr-xsrc/pdm-dialog.c9
3 files changed, 29 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index aa7377ec9..41922e9be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-07-27 Christian Persch <chpe@cvs.gnome.org>
+
+ * lib/widgets/ephy-node-view.c: (ephy_node_view_remove):
+
+ Fix mem leak.
+
+ * lib/widgets/ephy-node-view.c: (ephy_node_view_remove):
+ * src/pdm-dialog.c: (pdm_cmd_delete_selection):
+
+ If we've just deleted every row in the tree view, the row ref
+ contains an empty path. Check for that; possibly fixing bug #118398.
+
2003-07-25 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/widgets/ephy-search-entry.c: (ephy_search_entry_destroy_cb),
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c
index 839947101..86eb48f49 100644
--- a/lib/widgets/ephy-node-view.c
+++ b/lib/widgets/ephy-node-view.c
@@ -949,7 +949,7 @@ ephy_node_view_get_selection (EphyNodeView *view)
void
ephy_node_view_remove (EphyNodeView *view)
{
- GList *list;
+ GList *list, *l;
EphyNode *node;
GtkTreeIter iter, iter2;
GtkTreePath *path;
@@ -986,9 +986,9 @@ ephy_node_view_remove (EphyNodeView *view)
}
gtk_tree_path_free (path);
- for (; list != NULL; list = list->next)
+ for (l = list; l != NULL; l = l->next)
{
- ephy_node_unref (list->data);
+ ephy_node_unref (l->data);
}
g_list_free (list);
@@ -998,9 +998,14 @@ ephy_node_view_remove (EphyNodeView *view)
if (row_ref != NULL)
{
path = gtk_tree_row_reference_get_path (row_ref);
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+
+ if (path != NULL)
+ {
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+ gtk_tree_path_free (path);
+ }
+
gtk_tree_row_reference_free (row_ref);
- gtk_tree_path_free (path);
}
}
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index 981016d67..45a816939 100755
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -430,9 +430,14 @@ pdm_cmd_delete_selection (PdmActionInfo *action)
if (row_ref != NULL)
{
path = gtk_tree_row_reference_get_path (row_ref);
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (action->treeview), path, NULL, FALSE);
+
+ if (path != NULL)
+ {
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (action->treeview), path, NULL, FALSE);
+ gtk_tree_path_free (path);
+ }
+
gtk_tree_row_reference_free (row_ref);
- gtk_tree_path_free (path);
}
}