mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-23 18:24:59 +00:00
ZVISION: Fix memory leaks
This commit is contained in:
parent
2bfefd9691
commit
b3eb48996a
@ -65,7 +65,7 @@ void ZVision::processEvents() {
|
||||
initGraphics(_width, _height, true, &_pixelFormat);
|
||||
delete _currentVideo;
|
||||
_currentVideo = 0;
|
||||
delete _scaledVideoFrameBuffer;
|
||||
delete[] _scaledVideoFrameBuffer;
|
||||
_scaledVideoFrameBuffer = 0;
|
||||
}
|
||||
break;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -118,7 +118,7 @@ void ZVision::continueVideo() {
|
||||
initGraphics(_width, _height, true, &_pixelFormat);
|
||||
delete _currentVideo;
|
||||
_currentVideo = 0;
|
||||
delete _scaledVideoFrameBuffer;
|
||||
delete[] _scaledVideoFrameBuffer;
|
||||
_scaledVideoFrameBuffer = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user