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(); }