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 13, 2011
1 parent 4c70d39 commit afb1b3d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions engines/scumm/scumm.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
)
Expand Down

2 comments on commit afb1b3d

@fingolfin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also useful for 1.3.1 resp. the 1.3.x branch? Same for your other commits...

@athrxx
Copy link
Contributor Author

@athrxx athrxx commented on afb1b3d Jun 14, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sure is. I'll add this and some others (including the audio device detection changes) to the branch...

Please sign in to comment.