aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/game.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-06-16 17:20:45 +0200
committerSven Hesse2012-06-16 17:20:45 +0200
commitb7ae6a93a983c7feaa7cf029967354bd176b8efc (patch)
treede2f5ab9b31a4d506e81a6400e274a496a623881 /engines/gob/game.cpp
parent026ef70b87f4b85476cb6a3d74ffb9170a170718 (diff)
downloadscummvm-rg350-b7ae6a93a983c7feaa7cf029967354bd176b8efc.tar.gz
scummvm-rg350-b7ae6a93a983c7feaa7cf029967354bd176b8efc.tar.bz2
scummvm-rg350-b7ae6a93a983c7feaa7cf029967354bd176b8efc.zip
GOB: Fix a segfault when quitting AJ's World
Diffstat (limited to 'engines/gob/game.cpp')
-rw-r--r--engines/gob/game.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 502a440005..0d1953322f 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -167,6 +167,13 @@ bool Environments::has(Resources *resources, uint8 startEnv, int16 except) const
return false;
}
+void Environments::deleted(Variables *variables) {
+ for (uint i = 0; i < kEnvironmentCount; i++) {
+ if (_environments[i].variables == variables)
+ _environments[i].variables = 0;
+ }
+}
+
bool Environments::clearMedia(uint8 env) {
if (env >= kEnvironmentCount)
return false;
@@ -947,6 +954,10 @@ void Game::switchTotSub(int16 index, int16 function) {
_environments.get(_curEnvironment);
}
+void Game::deletedVars(Variables *variables) {
+ _environments.deleted(variables);
+}
+
void Game::clearUnusedEnvironment() {
if (!_environments.has(_script)) {
delete _script;