diff options
Diffstat (limited to 'engines/director/resource.cpp')
-rw-r--r-- | engines/director/resource.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 4d5f9a9cd4..f422808b13 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -256,14 +256,21 @@ void DirectorEngine::clearSharedCast() { delete _sharedScore; + _sharedScore = nullptr; + delete _sharedDIB; delete _sharedSTXT; delete _sharedSound; delete _sharedBMP; + + _sharedDIB = nullptr; + _sharedSTXT = nullptr; + _sharedSound = nullptr; + _sharedBMP = nullptr; } void DirectorEngine::loadSharedCastsFrom(Common::String filename) { - if (_sharedScore) { + if (_sharedScore && _sharedScore->_movieArchive) { if (_sharedScore->_movieArchive->getFileName().equalsIgnoreCase(filename)) return; } @@ -284,6 +291,8 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) { if (!shardcst->openFile(filename)) { warning("No shared cast %s", filename.c_str()); + delete shardcst; + _sharedScore = new Score(this); return; |