Browse Source

Clear lastPath if user prompts to clear a previously-crashed patch

tags/v0.6.2
Andrew Belt 6 years ago
parent
commit
1fd0cc8b67
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/main.cpp

+ 4
- 4
src/main.cpp View File

@@ -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


Loading…
Cancel
Save