aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/glk/alan3/exe.cpp2
-rw-r--r--engines/glk/alan3/utils.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp
index 8c22742347..fbb0db53f4 100644
--- a/engines/glk/alan3/exe.cpp
+++ b/engines/glk/alan3/exe.cpp
@@ -205,7 +205,7 @@ void quitGame(CONTEXT) {
current.location = where(HERO, DIRECT);
para();
- while (TRUE) {
+ while (!g_vm->shouldQuit()) {
col = 1;
CALL0(g_io->statusLine)
printMessage(M_QUITACTION);
diff --git a/engines/glk/alan3/utils.cpp b/engines/glk/alan3/utils.cpp
index acbf8e490a..06ce3af7ae 100644
--- a/engines/glk/alan3/utils.cpp
+++ b/engines/glk/alan3/utils.cpp
@@ -49,8 +49,10 @@ void terminate(CONTEXT, int code) {
stopTranscript();
- if (memory)
+ if (memory) {
deallocate(memory);
+ memory = nullptr;
+ }
g_io->glk_exit();
LONG_JUMP