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/Net/ClientConnection.cpp | |
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/Net/ClientConnection.cpp')
-rw-r--r-- | src/Net/ClientConnection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Net/ClientConnection.cpp b/src/Net/ClientConnection.cpp index 2228b7a..10a03f1 100644 --- a/src/Net/ClientConnection.cpp +++ b/src/Net/ClientConnection.cpp @@ -31,7 +31,7 @@ void ClientConnection::handleConnect(const boost::system::error_code& error) { boost::lock_guard<boost::shared_mutex> lock(connectionLock); - socket->async_handshake(boost::asio::ssl::stream_base::client, boost::bind(&ClientConnection::handleHandshake, this, boost::asio::placeholders::error)); + socket.async_handshake(boost::asio::ssl::stream_base::client, boost::bind(&ClientConnection::handleHandshake, thisPtr.lock(), boost::asio::placeholders::error)); } void ClientConnection::connect(const boost::asio::ip::tcp::endpoint &address) throw(Core::Exception) { @@ -45,7 +45,7 @@ void ClientConnection::connect(const boost::asio::ip::tcp::endpoint &address) th peer = address; _setState(CONNECT); - socket->lowest_layer().async_connect(address, boost::bind(&ClientConnection::handleConnect, this, boost::asio::placeholders::error)); + socket.lowest_layer().async_connect(address, boost::bind(&ClientConnection::handleConnect, boost::dynamic_pointer_cast<ClientConnection>(thisPtr.lock()), boost::asio::placeholders::error)); } } |