aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorathrxx2011-06-13 03:00:03 +0200
committerathrxx2011-06-13 03:02:59 +0200
commitafb1b3d8d38c32f4a50c1033cec00cc859917463 (patch)
tree80b72277a2cd8f250001a15ced9032786b75f391 /engines/scumm
parent4c70d399330503e39841d6047435e26da2f189f2 (diff)
downloadscummvm-rg350-afb1b3d8d38c32f4a50c1033cec00cc859917463.tar.gz
scummvm-rg350-afb1b3d8d38c32f4a50c1033cec00cc859917463.tar.bz2
scummvm-rg350-afb1b3d8d38c32f4a50c1033cec00cc859917463.zip
SCUMM: fix engine destructor
(This is relevant for cases where the engine errors out early, before certain arrays get initialized).
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp12
1 files changed, 8 insertions, 4 deletions
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
)