summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2017-05-15 11:20:36 +0300
committerErnestas Kulik <ernestask@gnome.org>2017-05-15 15:06:24 +0300
commitb1d57bc5a979aaff20c8f08217de0fd0390a4b38 (patch)
tree5ad61e331af08a5d47d82a277a27a66db28f1c3f
parent8e8010de418327d9c5751b1f06e317d5ee9f75d2 (diff)
downloadnautilus-b1d57bc5a979aaff20c8f08217de0fd0390a4b38.tar.gz
file-operations: delete: use automatic cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=782650
-rw-r--r--src/nautilus-file-operations.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 4a805c28e..d665e61ba 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -2376,8 +2376,8 @@ delete_task_thread_func (GTask *task,
GCancellable *cancellable)
{
DeleteJob *job = task_data;
- GList *to_trash_files;
- GList *to_delete_files;
+ g_autoptr (GList) to_trash_files = NULL;
+ g_autoptr (GList) to_delete_files = NULL;
GList *l;
GFile *file;
gboolean confirmed;
@@ -2390,9 +2390,6 @@ delete_task_thread_func (GTask *task,
nautilus_progress_info_start (job->common.progress);
- to_trash_files = NULL;
- to_delete_files = NULL;
-
must_confirm_delete_in_trash = FALSE;
must_confirm_delete = FALSE;
files_skipped = 0;
@@ -2454,9 +2451,6 @@ delete_task_thread_func (GTask *task,
trash_files (common, to_trash_files, &files_skipped);
}
- g_list_free (to_trash_files);
- g_list_free (to_delete_files);
-
if (files_skipped == g_list_length (job->files))
{
/* User has skipped all files, report user cancel */