LURE: Fixed memory leaks in the LURE engine

svn-id: r32675
This commit is contained in:
Christopher Page 2008-06-12 18:11:09 +00:00
parent dd423f803b
commit a596879c8e
2 changed files with 5 additions and 10 deletions

View File

@ -103,6 +103,7 @@ LureEngine::~LureEngine() {
if (_initialised) {
// Delete and deinitialise subsystems
Surface::deinitialise();
Sound.destroy();
delete _fights;
delete _room;
delete _menu;
@ -164,14 +165,6 @@ void LureEngine::pauseEngineIntern(bool pause) {
}
}
/* This is not being used
void LureEngine::quitGame() {
_system->quit();
}
*/
const char *LureEngine::generateSaveName(int slotNumber) {
static char buffer[15];

View File

@ -85,8 +85,10 @@ SoundManager::~SoundManager() {
if (_soundData)
delete _soundData;
if (_driver)
if (_driver) {
_driver->close();
delete _driver;
}
_driver = NULL;
g_system->deleteMutex(_soundMutex);
@ -143,7 +145,7 @@ void SoundManager::bellsBodge() {
Room &room = Room::getReference();
RoomData *roomData = res.getRoom(room.roomNumber());
if (roomData->areaFlag != res.fieldList().getField(AREA_FLAG)) {
if (roomData && roomData->areaFlag != res.fieldList().getField(AREA_FLAG)) {
res.fieldList().setField(AREA_FLAG, roomData->areaFlag);
switch (roomData->areaFlag) {