aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2016-05-24 07:09:35 +0200
committerTorbjörn Andersson2016-05-24 07:09:35 +0200
commit4cac7d15112da7c25cda1ca45cc8ee95eed0716e (patch)
tree1129c43bd1d875135a60a6e339c48e3f06af16d9
parent0489a0d3079b05c718852c683eac12e00e6de969 (diff)
downloadscummvm-rg350-4cac7d15112da7c25cda1ca45cc8ee95eed0716e.tar.gz
scummvm-rg350-4cac7d15112da7c25cda1ca45cc8ee95eed0716e.tar.bz2
scummvm-rg350-4cac7d15112da7c25cda1ca45cc8ee95eed0716e.zip
GNAP: Fix memory leaks, reported by Valgrind
-rw-r--r--engines/gnap/gamesys.cpp3
-rw-r--r--engines/gnap/gnap.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/engines/gnap/gamesys.cpp b/engines/gnap/gamesys.cpp
index 26af3fb8ab..4b18fd14a3 100644
--- a/engines/gnap/gamesys.cpp
+++ b/engines/gnap/gamesys.cpp
@@ -65,6 +65,9 @@ GameSys::GameSys(GnapEngine *vm) : _vm(vm) {
}
GameSys::~GameSys() {
+ if (_frontSurface)
+ _frontSurface->free();
+ delete _frontSurface;
}
void GameSys::insertSequence(int sequenceId, int id, int sequenceId2, int id2, int flags, int totalDuration, int16 x, int16 y) {
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 8acc3eedae..7523cd4de5 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -157,6 +157,7 @@ Common::Error GnapEngine::run() {
_font = Graphics::loadTTFFont(*stream, 24);
if (!_font)
warning("Unable to load font");
+ delete stream;
#else
_font = nullptr;
#endif