diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c7d25..23613a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Other new features: * OS X: support 3Dconnexion devices (SpaceMouse, SpaceNavigator, etc). Bug fixes: + * Do not remove autosaves after successfully opening a file, preventing + data loss in case of two abnormal terminations in a row. * Three.js: correctly respond to controls when browser zoom is used. * OS X: do not completely hide main window when defocused. diff --git a/src/solvespace.cpp b/src/solvespace.cpp index b89044d..398cba0 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -132,7 +132,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) { saveFile = filename; bool success = fileLoaded && ReloadAllImported(/*canCancel=*/true); if(success) { - RemoveAutosave(); AddToRecentList(filename); } else { saveFile = ""; @@ -218,9 +217,6 @@ void SolveSpaceUI::Exit(void) { // And the default styles, colors and line widths and such. Style::FreezeDefaultStyles(); - // Exiting cleanly. - RemoveAutosave(); - ExitNow(); } @@ -415,6 +411,7 @@ bool SolveSpaceUI::OkayToStartNewFile(void) { return GetFilenameAndSave(false); case DIALOG_NO: + RemoveAutosave(); return true; case DIALOG_CANCEL: