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