From d84847995edcd9c2cb424ecf39f838210c9634b6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 21 Oct 2021 14:27:42 -0400 Subject: [PATCH] Save autosave patch on close in PatchManager instead of standalone adapter. --- adapters/standalone.cpp | 3 --- src/patch.cpp | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adapters/standalone.cpp b/adapters/standalone.cpp index fff268b5..45135a52 100644 --- a/adapters/standalone.cpp +++ b/adapters/standalone.cpp @@ -239,9 +239,6 @@ int main(int argc, char* argv[]) { } // Destroy context - if (!settings::headless) { - APP->patch->saveAutosave(); - } INFO("Destroying context"); delete APP; contextSet(NULL); diff --git a/src/patch.cpp b/src/patch.cpp index 22ceb971..e443d6b9 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -32,6 +32,10 @@ Manager::Manager() { Manager::~Manager() { // Dispatch onSave to all Modules so they save their patch storage, etc. APP->engine->prepareSave(); + // Save autosave if not headless + if (!settings::headless) { + APP->patch->saveAutosave(); + } cleanAutosave(); }