From cd9c5b8d87aaae48a058ae8d498bc81d0fed82ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be> Date: Mon, 27 Dec 2010 15:10:29 +0100 Subject: Avoid more valgrind warnings. 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_; diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp index e922f2d..be2f0af 100644 --- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp +++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp @@ -70,7 +70,8 @@ void OpenSSLContext::ensureLibraryInitialized() { OpenSSL_add_all_algorithms(); // Disable compression - /*STACK_OF(SSL_COMP)* compressionMethods = SSL_COMP_get_compression_methods(); + /* + STACK_OF(SSL_COMP)* compressionMethods = SSL_COMP_get_compression_methods(); sk_SSL_COMP_zero(compressionMethods);*/ isLibraryInitialized = true; -- cgit v0.10.2-6-g49f6