diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-08-27 02:51:16 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-08-27 02:51:16 +0200 |
commit | 59bec05e406a0cf55c52d13cecfe76dccf83cd19 (patch) | |
tree | 276b5d10e696148f9fd300f80ab8a7a0c6b0cd61 /src/Common | |
parent | c964aa2708ed2839ded3c35eed7338f3e81f568f (diff) | |
download | mad-59bec05e406a0cf55c52d13cecfe76dccf83cd19.tar mad-59bec05e406a0cf55c52d13cecfe76dccf83cd19.zip |
Net::Connection etc.: Einige Race Conditions gefixt
Keine sporadischen Abstürze mehr
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/AuthManager.cpp | 3 | ||||
-rw-r--r-- | src/Common/ClientConnection.cpp | 2 | ||||
-rw-r--r-- | src/Common/ClientConnection.h | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/AuthManager.cpp b/src/Common/AuthManager.cpp index 82fbda5..d21909d 100644 --- a/src/Common/AuthManager.cpp +++ b/src/Common/AuthManager.cpp @@ -18,9 +18,10 @@ */ #include "AuthManager.h" - #include "AuthBackend.h" +#include <boost/thread/locks.hpp> + namespace Mad { namespace Common { diff --git a/src/Common/ClientConnection.cpp b/src/Common/ClientConnection.cpp index 51b23fa..4182806 100644 --- a/src/Common/ClientConnection.cpp +++ b/src/Common/ClientConnection.cpp @@ -24,7 +24,7 @@ namespace Mad { namespace Common { -ClientConnection::ClientConnection(Core::Application *application) : Connection(application), connection(new Net::ClientConnection(application)) { +ClientConnection::ClientConnection(Core::Application *application) : Connection(application), connection(Net::ClientConnection::create(application)) { connection->connectSignalReceive(boost::bind(&ClientConnection::receive, this, _1)); } diff --git a/src/Common/ClientConnection.h b/src/Common/ClientConnection.h index b50f163..a02c461 100644 --- a/src/Common/ClientConnection.h +++ b/src/Common/ClientConnection.h @@ -37,14 +37,13 @@ namespace Common { class MAD_COMMON_EXPORT ClientConnection : public Connection { private: - Net::ClientConnection *connection; + boost::shared_ptr<Net::ClientConnection> connection; protected: virtual bool send(const Net::Packet &packet); public: ClientConnection(Core::Application *application); - virtual ~ClientConnection() {} void connect(const boost::asio::ip::tcp::endpoint &address) throw(Core::Exception); |