From 211842c2fbb79d53ed62b8f88e44fd2290512bd5 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 1 Apr 2011 22:52:12 -0400 Subject: SCUMM: Make sure finalize is called from o60_closeFile() --- engines/scumm/he/script_v60he.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/scumm') 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; } } -- cgit v1.2.3