diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a052e..4d4541c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,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 1c1a78c..6245feb 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -134,7 +134,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) { saveFile = filename; bool success = fileLoaded && ReloadAllImported(/*canCancel=*/true); if(success) { - RemoveAutosave(); AddToRecentList(filename); } else { saveFile = ""; @@ -220,9 +219,6 @@ void SolveSpaceUI::Exit() { // And the default styles, colors and line widths and such. Style::FreezeDefaultStyles(); - // Exiting cleanly. - RemoveAutosave(); - ExitNow(); } @@ -415,6 +411,7 @@ bool SolveSpaceUI::OkayToStartNewFile() { return GetFilenameAndSave(/*saveAs=*/false); case DIALOG_NO: + RemoveAutosave(); return true; case DIALOG_CANCEL: