aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2010-01-05 05:25:18 +0000
committerPaul Gilbert2010-01-05 05:25:18 +0000
commitc8f991e89b96aa33b221cfc2988f00e811044877 (patch)
tree947dfa7eabf7b027dd5b0fbac35bf5ebd9262b50 /engines
parent5fbbd5b8d998b086a20749e79aee4e9ab81b8cc9 (diff)
downloadscummvm-rg350-c8f991e89b96aa33b221cfc2988f00e811044877.tar.gz
scummvm-rg350-c8f991e89b96aa33b221cfc2988f00e811044877.tar.bz2
scummvm-rg350-c8f991e89b96aa33b221cfc2988f00e811044877.zip
Bugfix for crash if an error occurs before the game object (and thus the debugger) is created
svn-id: r47018
Diffstat (limited to 'engines')
-rw-r--r--engines/lure/game.cpp4
-rw-r--r--engines/lure/game.h1
-rw-r--r--engines/lure/lure.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index 1ff9819f33..10db7b0613 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -40,6 +40,10 @@ namespace Lure {
static Game *int_game = NULL;
+bool Game::isCreated() {
+ return int_game != NULL;
+}
+
Game &Game::getReference() {
return *int_game;
}
diff --git a/engines/lure/game.h b/engines/lure/game.h
index 06dcee750f..de3fbd9b1f 100644
--- a/engines/lure/game.h
+++ b/engines/lure/game.h
@@ -73,6 +73,7 @@ public:
Game();
virtual ~Game();
+ static bool isCreated();
static Game &getReference();
void saveToStream(WriteStream *stream);
void loadFromStream(ReadStream *stream);
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 8640ed2d24..4481b2f92e 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -254,7 +254,7 @@ void LureEngine::GUIError(const char *msg, ...) {
}
GUI::Debugger *LureEngine::getDebugger() {
- return &Game::getReference().debugger();
+ return !Game::isCreated() ? NULL : &Game::getReference().debugger();
}
void LureEngine::syncSoundSettings() {