diff options
author | David Turner | 2011-01-27 07:58:57 +0000 |
---|---|---|
committer | David Turner | 2011-01-27 07:58:57 +0000 |
commit | 73a440cfe250e3a06c46e832eaf76b7f668b91e2 (patch) | |
tree | db2a99d6b95081212bc4396be0b6b033c4ebada8 /engines/drascula | |
parent | 861fab3fb16f3704b08f5dead562adc82c9a5550 (diff) | |
download | scummvm-rg350-73a440cfe250e3a06c46e832eaf76b7f668b91e2.tar.gz scummvm-rg350-73a440cfe250e3a06c46e832eaf76b7f668b91e2.tar.bz2 scummvm-rg350-73a440cfe250e3a06c46e832eaf76b7f668b91e2.zip |
DRASCULA: Fix Memory Leaks in Rooms Table.
Minor whitespace fixes as well.
svn-id: r55560
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/drascula.cpp | 3 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 1 | ||||
-rw-r--r-- | engines/drascula/rooms.cpp | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 8bf190ed2d..cf0453b87c 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -59,7 +59,6 @@ static const GameSettings drasculaSettings[] = { }; DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { - _charMap = 0; _itemLocations = 0; _polX = 0; @@ -101,6 +100,8 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam _rnd = new Common::RandomSource(); g_eventRec.registerRandomSource(*_rnd, "drascula"); + _console = 0; + int cd_num = ConfMan.getInt("cdrom"); if (cd_num >= 0) _system->getAudioCDManager()->openCD(cd_num); diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 535a9005d2..9430e7b8e3 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -265,7 +265,6 @@ public: private: bool _fallBack; - }; class TextResourceParser { diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index c6dd9f29db..884697dec7 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -140,6 +140,18 @@ void DrasculaEngine::setupRoomsTable() { } void DrasculaEngine::freeRoomsTable() { + for (uint32 i = 0; i < _roomHandlers->roomParsers.size(); i++) + delete _roomHandlers->roomParsers[i]; + _roomHandlers->roomParsers.clear(); + + for (uint32 i = 0; i < _roomHandlers->roomPreupdaters.size(); i++) + delete _roomHandlers->roomPreupdaters[i]; + _roomHandlers->roomPreupdaters.clear(); + + for (uint32 i = 0; i < _roomHandlers->roomUpdaters.size(); i++) + delete _roomHandlers->roomUpdaters[i]; + _roomHandlers->roomUpdaters.clear(); + delete _roomHandlers; _roomHandlers = 0; } |