aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/graphics.cpp1
-rw-r--r--engines/m4/m4.cpp1
-rw-r--r--engines/m4/mads_scene.cpp7
-rw-r--r--engines/m4/mads_views.cpp1
4 files changed, 8 insertions, 2 deletions
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index fc5cb0f9f9..36de60af6c 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -74,6 +74,7 @@ M4Surface::~M4Surface() {
_madsVm->_palette->deleteRange(_rgbList);
delete _rgbList;
}
+ free();
}
void M4Surface::loadCodesM4(Common::SeekableReadStream *source) {
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index a5db6660d8..c30e946653 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -147,6 +147,7 @@ MadsM4Engine::~MadsM4Engine() {
delete _random;
delete _palette;
delete _globals;
+ delete _sound;
delete _resourceManager;
}
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index d910340930..269f33878c 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -678,7 +678,9 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
Common::String s(buffer2, 64);
setNames.push_back(s);
}
-
+
+ delete stream;
+
// Initialise a copy of the surfaces if they weren't provided
bool dsFlag = false, ssFlag = false;
int gfxSize = width * height;
@@ -696,6 +698,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
dsFlag = true;
}
+
// For Rex Nebular, read in the scene's compressed walk surface information
if (_vm->getGameType() == GType_RexNebular) {
assert(depthSurface);
@@ -712,7 +715,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
destP += runLength;
}
- delete walkData;
+ free(walkData);
delete stream;
}
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index 178fd90fd3..5c6c01293e 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -270,6 +270,7 @@ MadsTextDisplay::MadsTextDisplay(MadsView &owner): _owner(owner) {
for (int i = 0; i < TEXT_DISPLAY_SIZE; ++i) {
MadsTextDisplayEntry rec;
rec.active = false;
+ rec.expire = 0;
_entries.push_back(rec);
}
}