aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/data
diff options
context:
space:
mode:
authorJulien Templier2010-11-11 03:25:35 +0000
committerJulien Templier2010-11-11 03:25:35 +0000
commit3b66e53bbed7365607bb3804b990984646ad2376 (patch)
tree37c619c30694495a839b7e74a5ec3b4c452dd09b /engines/lastexpress/data
parentd1bd2497a584c415681bdc952b2fd430aeeb5e03 (diff)
downloadscummvm-rg350-3b66e53bbed7365607bb3804b990984646ad2376.tar.gz
scummvm-rg350-3b66e53bbed7365607bb3804b990984646ad2376.tar.bz2
scummvm-rg350-3b66e53bbed7365607bb3804b990984646ad2376.zip
LASTEXPRESS: Fix some memory leaks
- Reading past the end of file in SaveLoad::init - Missing deallocation of cache in SoundManager - Missing deallocation of coords in SceneHotspot - Missing deallocation of event handlers in LastExpressEngine::setEventHandlers - Missing deallocation of InSaveFile in SaveLoad::isSavegameValid - Missing deallocation of frames in Menu as reported by digitall svn-id: r54193
Diffstat (limited to 'engines/lastexpress/data')
-rw-r--r--engines/lastexpress/data/scene.cpp8
-rw-r--r--engines/lastexpress/data/scene.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp
index 8e90d93828..47266358f2 100644
--- a/engines/lastexpress/data/scene.cpp
+++ b/engines/lastexpress/data/scene.cpp
@@ -27,11 +27,19 @@
#include "lastexpress/data/background.h"
+#include "lastexpress/helpers.h"
#include "lastexpress/lastexpress.h"
#include "lastexpress/resource.h"
namespace LastExpress {
+SceneHotspot::~SceneHotspot() {
+ for (uint i = 0; i < _coords.size(); i++)
+ SAFE_DELETE(_coords[i]);
+
+ _coords.clear();
+}
+
SceneHotspot *SceneHotspot::load(Common::SeekableReadStream *stream) {
SceneHotspot *hs = new SceneHotspot();
diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h
index c4a34e127b..d4c8e7d0da 100644
--- a/engines/lastexpress/data/scene.h
+++ b/engines/lastexpress/data/scene.h
@@ -151,6 +151,7 @@ public:
uint32 next;
SceneHotspot() {}
+ ~SceneHotspot();
static SceneHotspot *load(Common::SeekableReadStream *stream);
bool isInside(const Common::Point &point);