From 0869e02c1be101ef582b3b79ded8ebab4f4dbb7c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 9 Jan 2020 18:07:23 +0100 Subject: DIRECTOR: Properly reastart movies --- engines/director/resource.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3