- Cleanup

- LoL: fix memory leak

svn-id: r40663
This commit is contained in:
Johannes Schickel 2009-05-17 22:44:58 +00:00
parent 28b5f1d290
commit bfe63b64a3
2 changed files with 6 additions and 1 deletions

View File

@ -400,6 +400,9 @@ LoLEngine::~LoLEngine() {
delete[] _defaultLegendData;
delete[] _mapCursorOverlay;
delete[] _mapOverlay;
for (Common::Array<const SpellProc*>::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();

View File

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