From 5b840118886666566b7f7659d610356244709e4f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 18 Aug 2021 23:12:54 +0200 Subject: [PATCH] ux: Only save a crash backup when there actually were any changes --- source/window/window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/window/window.cpp b/source/window/window.cpp index 3748d657f..bd8a27967 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -190,6 +190,9 @@ namespace hex { constexpr auto CrashBackupFileName = "crash_backup.hexproj"; EventManager::subscribe(this, [CrashBackupFileName](int signal) { + if (!ProjectFile::hasUnsavedChanges()) + return; + for (const auto &path : hex::getPath(ImHexPath::Config)) { if (ProjectFile::store((std::filesystem::path(path) / CrashBackupFileName).string())) break;