[Scummvm-git-logs] scummvm master -> 43438fbe1365115f1a4df1a452d14677fca3c86b
sev-
sev at scummvm.org
Sun Nov 13 16:37:11 CET 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
43438fbe13 CHEWY: Plug memory leaks
Commit: 43438fbe1365115f1a4df1a452d14677fca3c86b
https://github.com/scummvm/scummvm/commit/43438fbe1365115f1a4df1a452d14677fca3c86b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-13T16:36:43+01:00
Commit Message:
CHEWY: Plug memory leaks
Changed paths:
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
engines/chewy/graphics.cpp
engines/chewy/sound.cpp
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 21e334d..6cd5a47 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -345,7 +345,7 @@ OSystem::TransactionError SurfaceSdlGraphicsManager::endGFXTransaction() {
#if SDL_VERSION_ATLEAST(2, 0, 0)
} else if (_videoMode.filtering != _oldVideoMode.filtering) {
errors |= OSystem::kTransactionFilteringFailed;
-
+
_videoMode.filtering = _oldVideoMode.filtering;
#endif
#ifdef USE_RGB_COLOR
@@ -2350,7 +2350,7 @@ bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
internUpdateScreen();
return true;
}
-
+
#if SDL_VERSION_ATLEAST(2, 0, 0)
// Ctrl-Alt-f toggles filtering
if (key == 'f') {
@@ -2595,7 +2595,7 @@ void SurfaceSdlGraphicsManager::recreateScreenTexture() {
return;
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, _videoMode.filtering ? "linear" : "nearest");
-
+
SDL_Texture *oldTexture = _screenTexture;
_screenTexture = SDL_CreateTexture(_renderer, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, _videoMode.hardwareWidth, _videoMode.hardwareHeight);
if (_screenTexture)
@@ -2627,7 +2627,7 @@ SDL_Surface *SurfaceSdlGraphicsManager::SDL_SetVideoMode(int width, int height,
SDL_GetWindowSize(_window->getSDLWindow(), &_windowWidth, &_windowHeight);
setWindowResolution(_windowWidth, _windowHeight);
-
+
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, _videoMode.filtering ? "linear" : "nearest");
_screenTexture = SDL_CreateTexture(_renderer, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, width, height);
diff --git a/engines/chewy/graphics.cpp b/engines/chewy/graphics.cpp
index 07a3abe..54a731f 100644
--- a/engines/chewy/graphics.cpp
+++ b/engines/chewy/graphics.cpp
@@ -140,6 +140,9 @@ void Graphics::playVideo(uint num) {
g_system->getPaletteManager()->setPalette(curPalette, 0, 256);
_vm->_cursor->showCursor();
+
+ delete videoResource;
+ delete cfoDecoder;
}
} // End of namespace Chewy
diff --git a/engines/chewy/sound.cpp b/engines/chewy/sound.cpp
index 36f2d63..843387d 100644
--- a/engines/chewy/sound.cpp
+++ b/engines/chewy/sound.cpp
@@ -100,7 +100,7 @@ void Sound::playMusic(int num, bool loop) {
uint32 musicNum = _soundRes->getChunkCount() - 1 - num;
Chunk *chunk = _soundRes->getChunk(musicNum);
byte *data = _soundRes->getChunkData(musicNum);
-
+
playMusic(data, chunk->size, loop);
delete[] data;
@@ -252,6 +252,8 @@ void Sound::convertTMFToMod(byte *tmfData, uint32 tmfSize, byte *modData, uint32
// TODO: 31 bytes instrument positions
// TODO: notes
+
+ free(modData);
}
} // End of namespace Chewy
More information about the Scummvm-git-logs
mailing list