diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-01-08 06:11:56 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-01-08 06:11:56 +0000 |
commit | 9b6e5a3189311d5704993d41a1fa195e006a57af (patch) | |
tree | ba460bd206148e7e072ce8ff273314a7f88d45ff /src/net | |
parent | a4dc1b83d8760f80e5cdcfded5473ec7c2c76d6d (diff) | |
download | mana-9b6e5a3189311d5704993d41a1fa195e006a57af.tar.gz mana-9b6e5a3189311d5704993d41a1fa195e006a57af.tar.bz2 mana-9b6e5a3189311d5704993d41a1fa195e006a57af.tar.xz mana-9b6e5a3189311d5704993d41a1fa195e006a57af.zip |
Fix a segfault when exiting before netcode is loaded
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/net.cpp | 15 | ||||
-rw-r--r-- | src/net/net.h | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp index 50baac73..3b380367 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -121,10 +121,9 @@ Net::TradeHandler *Net::getTradeHandler() namespace Net { - ServerInfo::Type networkType = ServerInfo::UNKNOWN; -} // namespace Net +ServerInfo::Type networkType = ServerInfo::UNKNOWN; -void Net::connectToServer(const ServerInfo &server) +void connectToServer(const ServerInfo &server) { // Remove with ifdefs if (networkType != ServerInfo::UNKNOWN) @@ -189,3 +188,13 @@ void Net::connectToServer(const ServerInfo &server) getLoginHandler()->connect(); } + +void unload() { + GeneralHandler *handler = getGeneralHandler(); + if (handler) + { + handler->unload(); + } +} + +} // namespace Net
\ No newline at end of file diff --git a/src/net/net.h b/src/net/net.h index 5e675df7..d6bb7d39 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -63,6 +63,8 @@ TradeHandler *getTradeHandler(); */ void connectToServer(const ServerInfo &server); +void unload(); + } // namespace Net #endif // NET_H |