From bfe63b64a3fe50e2fd7a7699555d258dcb84cda8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 May 2009 22:44:58 +0000 Subject: [PATCH] - Cleanup - LoL: fix memory leak svn-id: r40663 --- engines/kyra/lol.cpp | 5 +++++ engines/kyra/saveload_lok.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index c56357ea1f4..d1fe6338c0b 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -400,6 +400,9 @@ LoLEngine::~LoLEngine() { delete[] _defaultLegendData; delete[] _mapCursorOverlay; delete[] _mapOverlay; + + for (Common::Array::iterator i = _spellProcs.begin(); i != _spellProcs.end(); ++i) + delete *i; _spellProcs.clear(); } @@ -544,6 +547,8 @@ Common::Error LoLEngine::go() { if (!_flags.isDemo && !_res->loadFileList("FILEDATA.FDT")) error("Couldn't load file list: 'FILEDATA.FDT'"); + // Usually fonts etc. would be setup by the prologue code, if we skip + // the prologue code we need to setup them manually here. if (_gameToLoad != -1) preInit(); diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index d5ff36480ce..0f561dace08 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -162,7 +162,7 @@ Common::Error KyraEngine_LoK::loadGameState(int slot) { // In the first version when this entry was introduced, // it wasn't made sure that _curSfxFile was initialized // so if it's out of bounds we just set it to 0. - if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { + if (_flags.platform == Common::kPlatformFMTowns) { if (_curSfxFile >= _soundData->fileListLen || _curSfxFile < 0) _curSfxFile = 0; _sound->loadSoundFile(_curSfxFile);