aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-02-15 02:15:36 +0800
committerMilan Crha <mcrha@redhat.com>2011-02-15 02:15:36 +0800
commit4b9ac3879d25d14cbaaab9237626257c3561f7ff (patch)
treef9a445d2652644ea9ed64da2cd76f1ad442e83b3 /mail/em-folder-tree.c
parentcf41379058d6e78ea138603186acb8174c58e0ca (diff)
downloadgsoc2013-evolution-4b9ac3879d25d14cbaaab9237626257c3561f7ff.tar.gz
gsoc2013-evolution-4b9ac3879d25d14cbaaab9237626257c3561f7ff.tar.zst
gsoc2013-evolution-4b9ac3879d25d14cbaaab9237626257c3561f7ff.zip
Fix few memory leaks
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 3472d690ce..51a116f643 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -2027,7 +2027,7 @@ tree_drag_data_received (GtkWidget *widget,
GtkTreeViewDropPosition pos;
GtkTreeModel *model;
GtkTreeView *tree_view;
- GtkTreePath *dest_path;
+ GtkTreePath *dest_path = NULL;
EMailSession *session;
struct _DragDataReceivedAsync *m;
gboolean is_store;
@@ -2046,16 +2046,19 @@ tree_drag_data_received (GtkWidget *widget,
/* this means we are receiving no data */
if (gtk_selection_data_get_data (selection) == NULL) {
gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME);
+ gtk_tree_path_free (dest_path);
return;
}
if (gtk_selection_data_get_length (selection) == -1) {
gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME);
+ gtk_tree_path_free (dest_path);
return;
}
if (!gtk_tree_model_get_iter (model, &iter, dest_path)) {
gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME);
+ gtk_tree_path_free (dest_path);
return;
}
@@ -2068,6 +2071,7 @@ tree_drag_data_received (GtkWidget *widget,
/* make sure user isn't try to drop on a placeholder row */
if (full_name == NULL && !is_store) {
gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME);
+ gtk_tree_path_free (dest_path);
return;
}
@@ -2083,6 +2087,7 @@ tree_drag_data_received (GtkWidget *widget,
m->selection = gtk_selection_data_copy (selection);
tree_drag_data_action (m);
+ gtk_tree_path_free (dest_path);
}
static gboolean
@@ -2475,7 +2480,7 @@ tree_drag_motion (GtkWidget *widget,
GdkDragAction actions;
GdkDragAction suggested_action;
GdkDragAction chosen_action = 0;
- GtkTreePath *path;
+ GtkTreePath *path = NULL;
GtkTreeIter iter;
GdkAtom target;
gint i;
@@ -2552,6 +2557,7 @@ tree_drag_motion (GtkWidget *widget,
}
gdk_drag_status (context, chosen_action, time);
+ gtk_tree_path_free (path);
return chosen_action != 0;
}