ux: Only save a crash backup when there actually were any changes

This commit is contained in:
WerWolv 2021-08-18 23:12:54 +02:00
parent 63f4d553cc
commit 5b84011888

View file

@ -190,6 +190,9 @@ namespace hex {
constexpr auto CrashBackupFileName = "crash_backup.hexproj";
EventManager::subscribe<EventAbnormalTermination>(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;