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
+3 -1
View File
@@ -1092,6 +1092,7 @@ LRESULT CALLBACK FrameWndProc (
g_TimerIDEvent_100msec = 0;
}
LogFileOutput("WM_CLOSE (done)\n");
// Exit via DefWindowProc(), which does the default action for WM_CLOSE, which is to call DestroyWindow(), posting WM_DESTROY
break;
case WM_CHAR:
@@ -1175,7 +1176,8 @@ LRESULT CALLBACK FrameWndProc (
case WM_DESTROY:
LogFileOutput("WM_DESTROY\n");
DragAcceptFiles(window,0);
Snapshot_Shutdown();
if (!g_bRestart) // GH#564: Only save-state on shutdown (not on a restart)
Snapshot_Shutdown();
DebugDestroy();
if (!g_bRestart) {
DiskDestroy();