From 677318e7e52265b00ba6eef5c93e56bf145093cf Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 26 Jun 2018 19:13:19 -0400 Subject: [PATCH] Clear lastPath if user prompts to clear a previously-crashed patch --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6bc28b6f..336f4d52 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,20 +62,20 @@ int main(int argc, char* argv[]) { settingsLoad(assetLocal("settings.json")); if (patchFile.empty()) { - std::string oldLastPath = gRackWidget->lastPath; // To prevent launch crashes, if Rack crashes between now and 15 seconds from now, the "skipAutosaveOnLaunch" property will remain in settings.json, so that in the next launch, the broken autosave will not be loaded. bool oldSkipAutosaveOnLaunch = gSkipAutosaveOnLaunch; gSkipAutosaveOnLaunch = true; settingsSave(assetLocal("settings.json")); gSkipAutosaveOnLaunch = false; - if (oldSkipAutosaveOnLaunch && osdialog_message(OSDIALOG_INFO, OSDIALOG_YES_NO, "Rack has recovered from a crash, possibly caused by a faulty module in your patch. Would you like to clear your patch and start over?")) { - // Do nothing. Empty patch is already loaded. + if (oldSkipAutosaveOnLaunch && osdialog_message(OSDIALOG_INFO, OSDIALOG_YES_NO, "Rack has recovered from a crash, possibly caused by a faulty module in your patch. Clear your patch and start over?")) { + gRackWidget->lastPath = ""; } else { // Load autosave + std::string oldLastPath = gRackWidget->lastPath; gRackWidget->loadPatch(assetLocal("autosave.vcv")); + gRackWidget->lastPath = oldLastPath; } - gRackWidget->lastPath = oldLastPath; } else { // Load patch