summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-15 12:09:45 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-17 22:21:53 +0200
commitda03d6fcdd76774fd97e94227f32b9574f52bc18 (patch)
tree9505510e5f9899e3a29e0fb99094441ff343149e /src/main.cpp
parentb86b23225eedc5ca7fe313cc6485138e1f69cadb (diff)
downloadmana-da03d6fcdd76774fd97e94227f32b9574f52bc18.tar.gz
mana-da03d6fcdd76774fd97e94227f32b9574f52bc18.tar.bz2
mana-da03d6fcdd76774fd97e94227f32b9574f52bc18.tar.xz
mana-da03d6fcdd76774fd97e94227f32b9574f52bc18.zip
Fixed a possible crash on logging in to the map server
The Game instance was created too late, in some cases after messages were received by the BeingHandler. This caused crashes since the BeingHandler tried to use the BeingManager, which hadn't been created yet. (cherry picked from commit c7e57369f066ee9b7f9f62eacb19e2d10f8e13c5)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 40b30899..07bcd3f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -159,6 +159,7 @@ extern Net::Connection *accountServerConnection;
#endif
Graphics *graphics;
+Game *game = 0;
unsigned char state;
std::string errorMessage;
@@ -910,7 +911,6 @@ int main(int argc, char *argv[])
// Needs to be created in main, as the updater uses it
guiPalette = new Palette;
- Game *game = NULL;
Window *currentDialog = NULL;
#ifdef TMWSERV_SUPPORT
QuitDialog* quitDialog = NULL;
@@ -1290,6 +1290,7 @@ int main(int argc, char *argv[])
game = new Game;
game->logic();
delete game;
+ game = 0;
state = STATE_EXIT;
@@ -1467,9 +1468,9 @@ int main(int argc, char *argv[])
desktop = NULL;
logger->log("State: GAME");
- game = new Game;
game->logic();
delete game;
+ game = 0;
state = STATE_EXIT;
break;