changeset 22323:42724bd41274

Plug some leaks caused by GtkTreePaths not being freed.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 20 Feb 2008 05:07:09 +0000
parents 01e814b7556b
children 27d87096e6bc 4345e7aaa7d4 6fc8f0c825e0
files pidgin/gtkaccount.c pidgin/gtkblist.c pidgin/gtklog.c
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkaccount.c	Wed Feb 20 03:04:47 2008 +0000
+++ b/pidgin/gtkaccount.c	Wed Feb 20 05:07:09 2008 +0000
@@ -2092,8 +2092,10 @@
 	/* Figure out which node was clicked */
 	if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL))
 		return FALSE;
-	if (column == gtk_tree_view_get_column(treeview, 0))
+	if (column == gtk_tree_view_get_column(treeview, 0)) {
+		gtk_tree_path_free(path);
 		return FALSE;
+	}
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path);
 	gtk_tree_path_free(path);
--- a/pidgin/gtkblist.c	Wed Feb 20 03:04:47 2008 +0000
+++ b/pidgin/gtkblist.c	Wed Feb 20 05:07:09 2008 +0000
@@ -2953,6 +2953,9 @@
 	gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), x, y, &path, NULL, NULL, NULL);
 	gtk_tree_view_get_cell_area(GTK_TREE_VIEW(tv), path, NULL, &rect);
 
+	if (path)
+		gtk_tree_path_free(path);
+
 	/* Only autoexpand when in the middle of the cell to avoid annoying un-intended expands */
 	if (y < rect.y + (rect.height / 3) ||
 	    y > rect.y + (2 * (rect.height /3)))
@@ -2963,8 +2966,6 @@
 
 	gtkblist->tip_rect = rect;
 
-	if (path)
-		gtk_tree_path_free(path);
 	gtkblist->drag_timeout = g_timeout_add(delay, (GSourceFunc)pidgin_blist_expand_timeout, tv);
 
 	if (gtkblist->mouseover_contact) {
--- a/pidgin/gtklog.c	Wed Feb 20 03:04:47 2008 +0000
+++ b/pidgin/gtklog.c	Wed Feb 20 05:07:09 2008 +0000
@@ -263,11 +263,10 @@
 				gtk_tree_store_remove(treestore, iter);
 			}
 		}
-		gtk_tree_path_free(path);
 #else
 		gtk_tree_store_remove(treestore, iter);
+#endif
 		gtk_tree_path_free(path);
-#endif
 	}
 
 	delete_log_cleanup_cb(data);
@@ -363,6 +362,7 @@
 		gtk_tree_model_get_iter(GTK_TREE_MODEL(lv->treestore), iter, path);
 		val.g_type = 0;
 		gtk_tree_model_get_value(GTK_TREE_MODEL(lv->treestore), iter, 1, &val);
+		gtk_tree_path_free(path);
 
 		log = g_value_get_pointer(&val);