diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-10 15:02:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-11 21:53:46 (GMT) |
commit | 5fa9ecb3dff1a5918c202b72a5db313c0b7b879a (patch) | |
tree | efd7abfd306e5e2f773bdc62c7bf1ed491c5c410 /Swiften/Network/Connector.cpp | |
parent | bc6a510af449b6e383a11fc20c9859b8bcac247c (diff) | |
download | swift-contrib-5fa9ecb3dff1a5918c202b72a5db313c0b7b879a.zip swift-contrib-5fa9ecb3dff1a5918c202b72a5db313c0b7b879a.tar.bz2 |
Fixed some memory leaks.
Diffstat (limited to 'Swiften/Network/Connector.cpp')
-rw-r--r-- | Swiften/Network/Connector.cpp | 9 |
1 files changed, 8 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); } |