diff options
| author | Torbjörn Andersson | 2010-01-03 19:37:43 +0000 |
|---|---|---|
| committer | Torbjörn Andersson | 2010-01-03 19:37:43 +0000 |
| commit | 72eb9ec9eab5efcb3aa99a962a80423e8c0a3232 (patch) | |
| tree | 032c9107838aefca6a166465a46fa7318bb82566 /engines/lure | |
| parent | 910ffb53a0b6c74a965df9a1270cdfc3885252ec (diff) | |
| download | scummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.tar.gz scummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.tar.bz2 scummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.zip | |
Fixed a bunch of cppcheck warnings. Mostly about checking if a pointer is null
before freeing it, which isn't necessary.
svn-id: r46941
Diffstat (limited to 'engines/lure')
| -rw-r--r-- | engines/lure/animseq.cpp | 3 | ||||
| -rw-r--r-- | engines/lure/disk.cpp | 2 | ||||
| -rw-r--r-- | engines/lure/fights.cpp | 5 | ||||
| -rw-r--r-- | engines/lure/hotspots.cpp | 2 | ||||
| -rw-r--r-- | engines/lure/intro.cpp | 9 | ||||
| -rw-r--r-- | engines/lure/menu.cpp | 2 | ||||
| -rw-r--r-- | engines/lure/res_struct.cpp | 2 | ||||
| -rw-r--r-- | engines/lure/room.cpp | 5 | ||||
| -rw-r--r-- | engines/lure/sound.cpp | 6 |
9 files changed, 18 insertions, 18 deletions
diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp index f53b532815..9c18cb33aa 100644 --- a/engines/lure/animseq.cpp +++ b/engines/lure/animseq.cpp @@ -213,8 +213,7 @@ AnimationSequence::AnimationSequence(uint16 screenId, Palette &palette, bool fa } AnimationSequence::~AnimationSequence() { - if (_lineRefs != NULL) - delete _lineRefs; + delete _lineRefs; delete _decodedData; // Renable GMM saving/loading now that the animation is done diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp index b04cbdac27..4c6ebc8962 100644 --- a/engines/lure/disk.cpp +++ b/engines/lure/disk.cpp @@ -49,7 +49,7 @@ Disk::Disk() { } Disk::~Disk() { - if (_fileHandle) delete _fileHandle; + delete _fileHandle; int_disk = NULL; } diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 930d46640e..c5c49f1744 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -49,9 +49,8 @@ FightsManager::FightsManager() : _rnd(LureEngine::getReference().rnd()) { } FightsManager::~FightsManager() { - if (_fightData != NULL) - // Release the fight data - delete _fightData; + // Release the fight data + delete _fightData; } FightsManager &FightsManager::getReference() { diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 9fa55ef33d..0837f970f2 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -199,7 +199,7 @@ Hotspot::Hotspot(): _pathFinder(NULL) { } Hotspot::~Hotspot() { - if (_frames) delete _frames; + delete _frames; } void Hotspot::setAnimation(uint16 newAnimId) { diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp index 5afc2d7aaf..e054408a49 100644 --- a/engines/lure/intro.cpp +++ b/engines/lure/intro.cpp @@ -131,8 +131,13 @@ bool Introduction::show() { anim = new AnimationSequence(curr_anim->resourceId, isEGA ? EgaPalette : coll.getPalette(curr_anim->paletteIndex), fadeIn, (curr_anim->resourceId == 0x44) ? 4 : 7); - if (curr_anim->initialPause != 0) - if (interruptableDelay(curr_anim->initialPause * 1000 / 50)) return true; + + if (curr_anim->initialPause != 0) { + if (interruptableDelay(curr_anim->initialPause * 1000 / 50)) { + delete anim; + return true; + } + } result = false; switch (anim->show()) { diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 4d91284364..746a4a8611 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -175,7 +175,7 @@ uint8 Menu::execute() { system.delayMillis(10); } - if (_surfaceMenu) delete _surfaceMenu; + delete _surfaceMenu; // Deselect the currently selected menu header if (_selectedMenu) diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index e86a95198a..040da94347 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -150,7 +150,7 @@ bool RoomExitData::insideRect(int16 xp, int16 yp) { RoomExitData *RoomExitList::checkExits(int16 xp, int16 yp) { iterator i; - for (i = begin(); i != end(); i++) { + for (i = begin(); i != end(); ++i) { RoomExitData *rec = (*i).get(); if (rec->insideRect(xp, yp)) { return rec; diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 6dddffac9c..7b61f39785 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -116,10 +116,9 @@ Room::Room(): _screen(Screen::getReference()) { Room::~Room() { for (int layerNum = 0; layerNum < _numLayers; ++layerNum) - if (_layers[layerNum]) - delete _layers[layerNum]; + delete _layers[layerNum]; - if (_talkDialog) delete _talkDialog; + delete _talkDialog; int_room = NULL; } diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 674d0209d3..be57c52b47 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -82,8 +82,7 @@ SoundManager::~SoundManager() { g_system->unlockMutex(_soundMutex); delete _descs; - if (_soundData) - delete _soundData; + delete _soundData; if (_driver) { _driver->close(); @@ -641,8 +640,7 @@ MidiMusic::~MidiMusic() { _parser->unloadMusic(); delete _parser; this->close(); - if (_decompressedSound != NULL) - delete _decompressedSound; + delete _decompressedSound; } void MidiMusic::setVolume(int volume) { |
