aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/he/script_v60he.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index 9d62a31f6d..7ecabd55e1 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -741,10 +741,14 @@ void ScummEngine_v60he::o60_openFile() {
void ScummEngine_v60he::o60_closeFile() {
int slot = pop();
if (0 <= slot && slot < 17) {
- delete _hInFileTable[slot];
- delete _hOutFileTable[slot];
+ if (_hOutFileTable[slot]) {
+ _hOutFileTable[slot]->finalize();
+ delete _hOutFileTable[slot];
+ _hOutFileTable[slot] = 0;
+ }
+
+ delete _hInFileTable[slot];
_hInFileTable[slot] = 0;
- _hOutFileTable[slot] = 0;
}
}