aboutsummaryrefslogtreecommitdiff
path: root/engines/director/director.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-03-01 09:31:12 +0100
committerEugene Sandulenko2017-03-01 10:50:35 +0100
commit3a7c0911224adc0d0d467dc530f62f97a8868bee (patch)
tree27105defbd90add88f974ab3b0d2ac4198888e64 /engines/director/director.cpp
parente7842795fe257dd465b2d5e36d71abed77edc244 (diff)
downloadscummvm-rg350-3a7c0911224adc0d0d467dc530f62f97a8868bee.tar.gz
scummvm-rg350-3a7c0911224adc0d0d467dc530f62f97a8868bee.tar.bz2
scummvm-rg350-3a7c0911224adc0d0d467dc530f62f97a8868bee.zip
DIRECTOR: Plug memory leak
Diffstat (limited to 'engines/director/director.cpp')
-rw-r--r--engines/director/director.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index a1ee253087..1f0c89780e 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -59,7 +59,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Load Patterns
loadPatterns();
- _sharedCasts = nullptr;
+ _sharedScore = nullptr;
_currentScore = nullptr;
_soundManager = nullptr;
@@ -67,7 +67,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_currentPaletteLength = 0;
_lingo = nullptr;
- _sharedCasts = nullptr;
+ _sharedScore = nullptr;
_sharedSound = nullptr;
_sharedBMP = nullptr;
_sharedSTXT = nullptr;
@@ -100,6 +100,7 @@ DirectorEngine::~DirectorEngine() {
delete _sharedBMP;
delete _sharedSTXT;
delete _sharedDIB;
+ delete _sharedScore;
delete _currentScore;
@@ -242,4 +243,11 @@ Common::HashMap<Common::String, Score *> *DirectorEngine::scanMovies(const Commo
return nameMap;
}
+Common::HashMap<int, Cast *> *DirectorEngine::getSharedCasts() {
+ if (_sharedScore)
+ return &_sharedScore->_casts;
+
+ return &_dummyCast;
+}
+
} // End of namespace Director