GNAP: Fix memory leaks, reported by Valgrind

This commit is contained in:
Torbjörn Andersson 2016-05-24 07:09:35 +02:00
parent 0489a0d307
commit 4cac7d1511
2 changed files with 4 additions and 0 deletions

View File

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

View File

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