diff options
Diffstat (limited to 'Swiften/Network')
-rw-r--r-- | Swiften/Network/Connector.cpp | 9 | ||||
-rw-r--r-- | Swiften/Network/Connector.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp index 34fdf0b..d9a4c5d 100644 --- a/Swiften/Network/Connector.cpp +++ b/Swiften/Network/Connector.cpp @@ -112,7 +112,7 @@ void Connector::tryConnect(const HostAddressPort& target) { assert(!currentConnection); //std::cout << "Connector::tryConnect() " << target.getAddress().toString() << " " << target.getPort() << std::endl; currentConnection = connectionFactory->createConnection(); - currentConnection->onConnectFinished.connect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1)); + connectFinishedConnection = currentConnection->onConnectFinished.connect(boost::bind(&Connector::handleConnectionConnectFinished, shared_from_this(), _1)); currentConnection->connect(target); } @@ -140,6 +140,13 @@ void Connector::finish(boost::shared_ptr<Connection> connection) { timer->stop(); timer.reset(); } + if (serviceQuery) { + serviceQuery.reset(); + } + if (addressQuery) { + addressQuery.reset(); + } + connectFinishedConnection.disconnect(); onConnectFinished(connection); } diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h index 6442a8f..36026de 100644 --- a/Swiften/Network/Connector.h +++ b/Swiften/Network/Connector.h @@ -65,5 +65,6 @@ namespace Swift { std::deque<HostAddress> addressQueryResults; bool queriedAllServices; boost::shared_ptr<Connection> currentConnection; + boost::bsignals::connection connectFinishedConnection; }; }; |