ZVISION: Fix memory leaks

This commit is contained in:
richiesams 2013-07-19 12:17:14 -05:00
parent 2bfefd9691
commit b3eb48996a
4 changed files with 6 additions and 2 deletions

View File

@ -65,7 +65,7 @@ void ZVision::processEvents() {
initGraphics(_width, _height, true, &_pixelFormat);
delete _currentVideo;
_currentVideo = 0;
delete _scaledVideoFrameBuffer;
delete[] _scaledVideoFrameBuffer;
_scaledVideoFrameBuffer = 0;
}
break;

View File

@ -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);

View File

@ -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

View File

@ -118,7 +118,7 @@ void ZVision::continueVideo() {
initGraphics(_width, _height, true, &_pixelFormat);
delete _currentVideo;
_currentVideo = 0;
delete _scaledVideoFrameBuffer;
delete[] _scaledVideoFrameBuffer;
_scaledVideoFrameBuffer = 0;
}