Fixed save-state on exit not working if there was a VM restart (eg. config h/w change). Fixes #564

This commit is contained in:
tomcw
2018-07-31 18:06:53 +01:00
parent 140d505fe9
commit 898f30f08a
2 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -637,17 +637,19 @@ void Snapshot_Startup()
Snapshot_LoadState();
bDone = true;
bDone = true; // Prevents a g_bRestart from loading an old save-state
}
void Snapshot_Shutdown()
{
static bool bDone = false;
_ASSERT(!bDone);
_ASSERT(!g_bRestart);
if(!g_bSaveStateOnExit || bDone)
return;
Snapshot_SaveState();
bDone = true;
bDone = true; // Debug flag: should only be called once, and never on a g_bRestart
}