From 474fc99690d271a6998e180372ea4b5fd624f45b Mon Sep 17 00:00:00 2001 From: ice0 Date: Feb 13 2020 15:48:16 +0000 Subject: Merge PR #1155: Clicking "Ignore" button doesn't removes backup Fix #1140: Clicking "Ignore" button doesn't removes backup --- diff --git a/synfig-studio/src/gui/autorecover.cpp b/synfig-studio/src/gui/autorecover.cpp index 908f373..5a9faf7 100644 --- a/synfig-studio/src/gui/autorecover.cpp +++ b/synfig-studio/src/gui/autorecover.cpp @@ -164,8 +164,13 @@ AutoRecover::clear_backups() // FileSystemTemporary will clear opened temporary files in destructor String filename = App::get_temporary_directory() + ETL_DIRECTORY_SEPARATOR + *i; bool s = false; - try { s = FileSystemTemporary("").open_temporary(filename); } - catch (...) { } + try { + FileSystemTemporary temporary_filesystem = FileSystemTemporary(""); + s = temporary_filesystem.open_temporary(filename); + temporary_filesystem.discard_changes(); + } catch (...) { + synfig::warning("Autobackup file is not recoverable. Forcing to remove."); + } if (!s) { FileSystemNative::instance()->file_remove(filename);