aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-07-19 12:17:14 -0500
committerrichiesams2013-08-04 13:32:32 -0500
commitb3eb48996af2236baf89dd5afd6cfeef1b5e86bd (patch)
tree7aae81c4742d59d8c6ee46438d466764efc85a63 /engines
parent2bfefd969128b0a33afc8beccf52a4e9f6e4840f (diff)
downloadscummvm-rg350-b3eb48996af2236baf89dd5afd6cfeef1b5e86bd.tar.gz
scummvm-rg350-b3eb48996af2236baf89dd5afd6cfeef1b5e86bd.tar.bz2
scummvm-rg350-b3eb48996af2236baf89dd5afd6cfeef1b5e86bd.zip
ZVISION: Fix memory leaks
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/events.cpp2
-rw-r--r--engines/zvision/render_manager.cpp2
-rw-r--r--engines/zvision/utility.cpp2
-rw-r--r--engines/zvision/video.cpp2
4 files changed, 6 insertions, 2 deletions
diff --git a/engines/zvision/events.cpp b/engines/zvision/events.cpp
index a3d6b6b670..afa2d95207 100644
--- a/engines/zvision/events.cpp
+++ b/engines/zvision/events.cpp
@@ -65,7 +65,7 @@ void ZVision::processEvents() {
initGraphics(_width, _height, true, &_pixelFormat);
delete _currentVideo;
_currentVideo = 0;
- delete _scaledVideoFrameBuffer;
+ delete[] _scaledVideoFrameBuffer;
_scaledVideoFrameBuffer = 0;
}
break;
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 671e7c0136..6d3f7c6fc1 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -59,6 +59,8 @@ void RenderManager::renderImageToScreen(const Common::String &fileName, uint32 x
stream.read(buffer, decompressedSize);
_system->copyRectToScreen(buffer, width * 2, x, y, width, height);
+
+ delete[] buffer;
} else {
// Reset the cursor
file.seek(0);
diff --git a/engines/zvision/utility.cpp b/engines/zvision/utility.cpp
index bf8e5c91d6..fa29fe660f 100644
--- a/engines/zvision/utility.cpp
+++ b/engines/zvision/utility.cpp
@@ -225,6 +225,8 @@ void convertRawToWav(const Common::String &inputFile, ZVision *engine, const Com
int16 *buffer = new int16[file.size()];
int readBytes = audioStream->readBuffer(buffer, file.size());
output.write(buffer, file.size() * 2);
+
+ delete[] buffer;
}
} // End of namespace ZVision
diff --git a/engines/zvision/video.cpp b/engines/zvision/video.cpp
index 0cca486af6..0428090003 100644
--- a/engines/zvision/video.cpp
+++ b/engines/zvision/video.cpp
@@ -118,7 +118,7 @@ void ZVision::continueVideo() {
initGraphics(_width, _height, true, &_pixelFormat);
delete _currentVideo;
_currentVideo = 0;
- delete _scaledVideoFrameBuffer;
+ delete[] _scaledVideoFrameBuffer;
_scaledVideoFrameBuffer = 0;
}