diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-27 14:10:29 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-27 14:10:29 (GMT) |
commit | cd9c5b8d87aaae48a058ae8d498bc81d0fed82ad (patch) | |
tree | 653077dbad716ed03052facd45fcdfc5bb182b86 /Swiften/Client | |
parent | ff700194d1d6e8e347a50912de9320f9c3d463bb (diff) | |
download | swift-cd9c5b8d87aaae48a058ae8d498bc81d0fed82ad.zip swift-cd9c5b8d87aaae48a058ae8d498bc81d0fed82ad.tar.bz2 |
Avoid more valgrind warnings.
Diffstat (limited to 'Swiften/Client')
-rw-r--r-- | Swiften/Client/CoreClient.cpp | 26 | ||||
-rw-r--r-- | Swiften/Client/CoreClient.h | 3 |
2 files changed, 23 insertions, 6 deletions
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp index b2bbad8..7b1f3fd 100644 --- a/Swiften/Client/CoreClient.cpp +++ b/Swiften/Client/CoreClient.cpp @@ -24,9 +24,9 @@ namespace Swift { CoreClient::CoreClient(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const String& password) : jid_(jid), password_(password), eventLoop(eventLoop), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) { stanzaChannel_ = new ClientSessionStanzaChannel(); - stanzaChannel_->onMessageReceived.connect(boost::ref(onMessageReceived)); - stanzaChannel_->onPresenceReceived.connect(boost::ref(onPresenceReceived)); - stanzaChannel_->onStanzaAcked.connect(boost::ref(onStanzaAcked)); + stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreClient::handleMessageReceived, this, _1)); + stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreClient::handlePresenceReceived, this, _1)); + stanzaChannel_->onStanzaAcked.connect(boost::bind(&CoreClient::handleStanzaAcked, this, _1)); stanzaChannel_->onAvailableChanged.connect(boost::bind(&CoreClient::handleStanzaChannelAvailableChanged, this, _1)); iqRouter_ = new IQRouter(stanzaChannel_); @@ -41,9 +41,9 @@ CoreClient::~CoreClient() { delete iqRouter_; stanzaChannel_->onAvailableChanged.disconnect(boost::bind(&CoreClient::handleStanzaChannelAvailableChanged, this, _1)); - stanzaChannel_->onMessageReceived.disconnect(boost::ref(onMessageReceived)); - stanzaChannel_->onPresenceReceived.disconnect(boost::ref(onPresenceReceived)); - stanzaChannel_->onStanzaAcked.disconnect(boost::ref(onStanzaAcked)); + stanzaChannel_->onMessageReceived.disconnect(boost::bind(&CoreClient::handleMessageReceived, this, _1)); + stanzaChannel_->onPresenceReceived.disconnect(boost::bind(&CoreClient::handlePresenceReceived, this, _1)); + stanzaChannel_->onStanzaAcked.disconnect(boost::bind(&CoreClient::handleStanzaAcked, this, _1)); delete stanzaChannel_; } @@ -251,4 +251,18 @@ void CoreClient::setCertificateTrustChecker(CertificateTrustChecker* checker) { certificateTrustChecker = checker; } + +void CoreClient::handlePresenceReceived(Presence::ref presence) { + onPresenceReceived(presence); +} + +void CoreClient::handleMessageReceived(Message::ref message) { + onMessageReceived(message); +} + +void CoreClient::handleStanzaAcked(Stanza::ref stanza) { + onStanzaAcked(stanza); +} + + } diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h index 925a357..bac78a3 100644 --- a/Swiften/Client/CoreClient.h +++ b/Swiften/Client/CoreClient.h @@ -200,6 +200,9 @@ namespace Swift { void handleNeedCredentials(); void handleDataRead(const String&); void handleDataWritten(const String&); + void handlePresenceReceived(Presence::ref); + void handleMessageReceived(Message::ref); + void handleStanzaAcked(Stanza::ref); private: JID jid_; |