From afb1b3d8d38c32f4a50c1033cec00cc859917463 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 13 Jun 2011 03:00:03 +0200 Subject: SCUMM: fix engine destructor (This is relevant for cases where the engine errors out early, before certain arrays get initialized). --- engines/scumm/scumm.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 36caff452d..dd26e23b4d 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -162,7 +162,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _pauseDialog = NULL; _versionDialog = NULL; _fastMode = 0; - _actors = NULL; + _actors = _sortedActors = NULL; _arraySlot = NULL; _inventory = NULL; _newNames = NULL; @@ -584,9 +584,12 @@ ScummEngine::~ScummEngine() { _mixer->stopAll(); - for (int i = 0; i < _numActors; ++i) - delete _actors[i]; - delete[] _actors; + if (_actors) { + for (int i = 0; i < _numActors; ++i) + delete _actors[i]; + delete[] _actors; + } + delete[] _sortedActors; delete[] _2byteFontPtr; @@ -1361,6 +1364,7 @@ void ScummEngine::resetScumm() { #ifdef USE_RGB_COLOR if (_game.features & GF_16BIT_COLOR #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE + || _game.platform == Common::kPlatformFMTowns #endif ) -- cgit v1.2.3