[gedit/gnome-3-14] filebrowser: fix small leak when renaming file



commit 7199dff3d3071abd65ad725e730d50bb5cfd27b0
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Jan 21 21:22:23 2015 +0100

    filebrowser: fix small leak when renaming file

 plugins/filebrowser/gedit-file-browser-view.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c
index 48ffc70..ffb4c53 100644
--- a/plugins/filebrowser/gedit-file-browser-view.c
+++ b/plugins/filebrowser/gedit-file-browser-view.c
@@ -995,8 +995,12 @@ cell_data_cb (GtkTreeViewColumn    *tree_column,
            obj->priv->editable != NULL &&
            gtk_tree_row_reference_valid (obj->priv->editable))
        {
-               GtkTreePath *edpath = gtk_tree_row_reference_get_path (obj->priv->editable);
+               GtkTreePath *edpath;
+
+               edpath = gtk_tree_row_reference_get_path (obj->priv->editable);
                editable = edpath && gtk_tree_path_compare (path, edpath) == 0;
+
+               gtk_tree_path_free (edpath);
        }
 
        gtk_tree_path_free (path);
@@ -1184,15 +1188,14 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView *tree_view,
        gtk_tree_view_column_focus_cell (tree_view->priv->column,
                                         tree_view->priv->text_renderer);
 
-       gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view),
-                                 gtk_tree_row_reference_get_path (tree_view->priv->editable),
+       path = gtk_tree_row_reference_get_path (tree_view->priv->editable),
+       gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path,
                                  tree_view->priv->column, TRUE);
-
        gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree_view),
-                                     gtk_tree_row_reference_get_path (tree_view->priv->editable),
-                                     tree_view->priv->column,
+                                     path, tree_view->priv->column,
                                      FALSE, 0.0, 0.0);
 
+       gtk_tree_path_free (path);
        g_value_unset (&name_escaped);
        g_free (name);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]