Skip to content

Commit

Permalink
SCUMM: fix engine destructor
Browse files Browse the repository at this point in the history
(This is relevant for cases where the engine errors out early, before certain arrays get initialized).
  • Loading branch information
athrxx committed Jun 14, 2011
1 parent ec8e616 commit 1c9f7fd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions engines/scumm/scumm.cpp
Expand Up @@ -161,7 +161,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;
Expand Down Expand Up @@ -586,9 +586,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;
Expand Down Expand Up @@ -1367,6 +1370,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
)
Expand Down

0 comments on commit 1c9f7fd

Please sign in to comment.