diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-21 04:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-21 04:02:07 +0300 |
commit | dd3ac96d868e5a3e7c230832b25aacd24e03719e (patch) | |
tree | 395ddce26bd249a943c7158188fe52c48809e6a5 /src/client.cpp | |
parent | 8fdaa55cfc951459b0ee079839cdf40e88baa2af (diff) | |
download | mv-dd3ac96d868e5a3e7c230832b25aacd24e03719e.tar.gz mv-dd3ac96d868e5a3e7c230832b25aacd24e03719e.tar.bz2 mv-dd3ac96d868e5a3e7c230832b25aacd24e03719e.tar.xz mv-dd3ac96d868e5a3e7c230832b25aacd24e03719e.zip |
Fix possible crash. Move unsafe initialisations from static members.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp index 5a06267f2..6611d3dcf 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -659,9 +659,6 @@ Client::~Client() ActorSprite::unload(); - delete SpriteReference::Empty; - SpriteReference::Empty = 0; - ResourceManager::deleteInstance(); logger->log1("Quitting8"); @@ -1029,6 +1026,14 @@ int Client::exec() // Read default paths file 'data/paths.xml' paths.init("paths.xml", true); paths.setDefaultValues(getPathsDefaults()); + if (!SpriteReference::Empty) + { + SpriteReference::Empty = new SpriteReference( + paths.getStringValue("spriteErrorFile"), 0); + } + + if (!BeingInfo::unknown) + BeingInfo::unknown = new BeingInfo; Mana::Event event(EVENT_STATECHANGE); event.setInt("newState", STATE_LOAD_DATA); |