From cda6fd478b3d8f7f30f771b18324db389a01b1b3 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Wed, 18 Nov 2015 15:08:45 +0100 Subject: Fix virtual destructors and mismatching signal disconnection Test-Information: Unit tests pass on OS X 10.10.5. Change-Id: I7b505513b4342001596ee8518bfdcf9e77c91479 diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp index 9a836cb..b04609f 100644 --- a/Swiften/Network/BOSHConnection.cpp +++ b/Swiften/Network/BOSHConnection.cpp @@ -91,7 +91,7 @@ void BOSHConnection::handleRawDataRead(boost::shared_ptr data) { tlsLayer_->handleDataRead(*data.get()); } -void BOSHConnection::handleTLSError(boost::shared_ptr error) { +void BOSHConnection::handleTLSError(boost::shared_ptr /* error */) { } diff --git a/Swiften/Network/PlatformDomainNameAddressQuery.cpp b/Swiften/Network/PlatformDomainNameAddressQuery.cpp index 99e5eda..8b72c3b 100644 --- a/Swiften/Network/PlatformDomainNameAddressQuery.cpp +++ b/Swiften/Network/PlatformDomainNameAddressQuery.cpp @@ -8,8 +8,8 @@ #include -#include #include +#include namespace Swift { @@ -20,6 +20,10 @@ PlatformDomainNameAddressQuery::PlatformDomainNameAddressQuery(const boost::opti } } +PlatformDomainNameAddressQuery::~PlatformDomainNameAddressQuery() { + +} + void PlatformDomainNameAddressQuery::run() { getResolver()->addQueryToQueue(shared_from_this()); } diff --git a/Swiften/Network/PlatformDomainNameAddressQuery.h b/Swiften/Network/PlatformDomainNameAddressQuery.h index 306612c..c241f2a 100644 --- a/Swiften/Network/PlatformDomainNameAddressQuery.h +++ b/Swiften/Network/PlatformDomainNameAddressQuery.h @@ -1,18 +1,19 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include #include +#include #include #include -#include -#include namespace Swift { class PlatformDomainNameResolver; @@ -21,6 +22,7 @@ namespace Swift { class PlatformDomainNameAddressQuery : public DomainNameAddressQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this, public EventOwner { public: PlatformDomainNameAddressQuery(const boost::optional& host, EventLoop* eventLoop, PlatformDomainNameResolver*); + virtual ~PlatformDomainNameAddressQuery(); void run(); diff --git a/Swiften/Network/PlatformDomainNameResolver.h b/Swiften/Network/PlatformDomainNameResolver.h index e2d28a9..ae94179 100644 --- a/Swiften/Network/PlatformDomainNameResolver.h +++ b/Swiften/Network/PlatformDomainNameResolver.h @@ -7,16 +7,17 @@ #pragma once #include -#include -#include + #include +#include +#include #include #include +#include #include -#include #include -#include +#include namespace Swift { class IDNConverter; @@ -25,7 +26,7 @@ namespace Swift { class SWIFTEN_API PlatformDomainNameResolver : public DomainNameResolver { public: PlatformDomainNameResolver(IDNConverter* idnConverter, EventLoop* eventLoop); - ~PlatformDomainNameResolver(); + virtual ~PlatformDomainNameResolver(); virtual DomainNameServiceQuery::ref createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain); virtual DomainNameAddressQuery::ref createAddressQuery(const std::string& name); diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.cpp b/Swiften/Network/PlatformDomainNameServiceQuery.cpp index d68f4bf..673aaff 100644 --- a/Swiften/Network/PlatformDomainNameServiceQuery.cpp +++ b/Swiften/Network/PlatformDomainNameServiceQuery.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -45,6 +45,10 @@ PlatformDomainNameServiceQuery::PlatformDomainNameServiceQuery(const boost::opti } } +PlatformDomainNameServiceQuery::~PlatformDomainNameServiceQuery() { + +} + void PlatformDomainNameServiceQuery::run() { getResolver()->addQueryToQueue(shared_from_this()); } diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.h b/Swiften/Network/PlatformDomainNameServiceQuery.h index 53d9f50..afc4a90 100644 --- a/Swiften/Network/PlatformDomainNameServiceQuery.h +++ b/Swiften/Network/PlatformDomainNameServiceQuery.h @@ -1,16 +1,17 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include -#include #include -#include +#include #include namespace Swift { @@ -19,6 +20,7 @@ namespace Swift { class PlatformDomainNameServiceQuery : public DomainNameServiceQuery, public PlatformDomainNameQuery, public boost::enable_shared_from_this, public EventOwner { public: PlatformDomainNameServiceQuery(const boost::optional& serviceName, EventLoop* eventLoop, PlatformDomainNameResolver* resolver); + virtual ~PlatformDomainNameServiceQuery(); virtual void run(); diff --git a/Swiften/StreamStack/ConnectionLayer.cpp b/Swiften/StreamStack/ConnectionLayer.cpp index 4546a9b..5bf07d0 100644 --- a/Swiften/StreamStack/ConnectionLayer.cpp +++ b/Swiften/StreamStack/ConnectionLayer.cpp @@ -1,10 +1,11 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include + #include namespace Swift { @@ -14,7 +15,7 @@ ConnectionLayer::ConnectionLayer(boost::shared_ptr connection) : con } ConnectionLayer::~ConnectionLayer() { - connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::writeDataToParentLayer, this, _1)); + connection->onDataRead.disconnect(boost::bind(&ConnectionLayer::handleDataRead, this, _1)); } void ConnectionLayer::handleDataRead(boost::shared_ptr data) { diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h index 2ff1c3c..e89e24c 100644 --- a/Swiften/StreamStack/ConnectionLayer.h +++ b/Swiften/StreamStack/ConnectionLayer.h @@ -9,14 +9,14 @@ #include #include -#include #include +#include namespace Swift { class SWIFTEN_API ConnectionLayer : public LowLayer { public: ConnectionLayer(boost::shared_ptr connection); - ~ConnectionLayer(); + virtual ~ConnectionLayer(); void writeData(const SafeByteArray& data) { connection->write(data); diff --git a/Swiften/StreamStack/TLSLayer.h b/Swiften/StreamStack/TLSLayer.h index 87d69a9..0ab35d5 100644 --- a/Swiften/StreamStack/TLSLayer.h +++ b/Swiften/StreamStack/TLSLayer.h @@ -6,14 +6,13 @@ #pragma once -#include - #include #include +#include #include #include -#include #include +#include #include #include @@ -24,7 +23,7 @@ namespace Swift { class SWIFTEN_API TLSLayer : public StreamLayer { public: TLSLayer(TLSContextFactory*, const TLSOptions&); - ~TLSLayer(); + virtual ~TLSLayer(); void connect(); bool setClientCertificate(CertificateWithKey::ref cert); -- cgit v0.10.2-6-g49f6