summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-06-03 14:12:42 -0600
committerJared Adams <jaxad0127@gmail.com>2010-06-03 14:23:08 -0600
commit8615f1bbad630602009c04a317cd83e03aaa620c (patch)
tree6f1aaade0f9d745536ec1bda73314cb0841a89e4 /src/client.cpp
parent24802c19b0c3ee287898a81a0257d27843d5d09d (diff)
downloadmana-8615f1bbad630602009c04a317cd83e03aaa620c.tar.gz
mana-8615f1bbad630602009c04a317cd83e03aaa620c.tar.bz2
mana-8615f1bbad630602009c04a317cd83e03aaa620c.tar.xz
mana-8615f1bbad630602009c04a317cd83e03aaa620c.zip
Unload loaded DBs before loading them again
This greatly simplifies handling DBs when changing states. No more need to manage unloading in Client (except when exiting). Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client.cpp b/src/client.cpp
index aa48591f..93450805 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -422,6 +422,14 @@ Client::~Client()
SDL_RemoveTimer(mLogicCounterId);
SDL_RemoveTimer(mSecondsCounterId);
+ // Unload XML databases
+ ColorDB::unload();
+ EmoteDB::unload();
+ ItemDB::unload();
+ MonsterDB::unload();
+ NPCDB::unload();
+ StatusEffect::unload();
+
// Before config.write() since it writes the shortcuts to the config
delete itemShortcut;
delete emoteShortcut;
@@ -575,14 +583,6 @@ int Client::exec()
{
delete game;
game = 0;
-
- // Unload XML databases
- ColorDB::unload();
- EmoteDB::unload();
- ItemDB::unload();
- MonsterDB::unload();
- NPCDB::unload();
- StatusEffect::unload();
}
mOldState = mState;