aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/scene.cpp5
-rw-r--r--engines/sherlock/sherlock.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 6e7f628616..8a47707aea 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -169,6 +169,9 @@ void Scene::selectScene() {
* Fres all the graphics and other dynamically allocated data for the scene
*/
void Scene::freeScene() {
+ if (_currentScene == -1)
+ return;
+
_vm->_talk->freeTalkVars();
_vm->_inventory->freeInv();
_vm->_sound->freeSong();
@@ -190,6 +193,8 @@ void Scene::freeScene() {
for (uint idx = 0; idx < _images.size(); ++idx)
delete _images[idx]._images;
_images.clear();
+
+ _currentScene = -1;
}
/**
diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp
index b8948f99d8..8b25615792 100644
--- a/engines/sherlock/sherlock.cpp
+++ b/engines/sherlock/sherlock.cpp
@@ -163,6 +163,7 @@ void SherlockEngine::sceneLoop() {
}
}
+ _scene->freeScene();
_people->freeWalk();
}