From 730a9d26ef340373796aeb020175fce0ed716865 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Wed, 13 Jan 2016 23:03:37 +0100 Subject: Add missing virtual keyword to some destructors Adds missing virtual keyword to destructors of classes which have a non-empty destructor and are inheriting from other classes and implement virtual functions. Test-Information: Compiles and unit tests pass on Windows 8 with VS 2013. Change-Id: I172b5de8eda63eb8057113fbc979444abde3e0a7 diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 4a849ce..bd05345 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -1,13 +1,14 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include + +#include #include namespace Swift { @@ -56,7 +57,7 @@ namespace Swift { * all data will be stored in memory (and be lost on shutdown) */ Client(const JID& jid, const SafeString& password, NetworkFactories* networkFactories, Storages* storages = NULL); - ~Client(); + virtual ~Client(); /** diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h index 79b05c6..002a704 100644 --- a/Swiften/Client/CoreClient.h +++ b/Swiften/Client/CoreClient.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,15 +7,16 @@ #pragma once #include + #include #include +#include #include -#include -#include #include #include -#include +#include +#include #include namespace Swift { @@ -52,7 +53,7 @@ namespace Swift { * Constructs a client for the given JID with the given password. */ CoreClient(const JID& jid, const SafeByteArray& password, NetworkFactories* networkFactories); - ~CoreClient(); + virtual ~CoreClient(); /** * Set a client certificate to use for strong authentication with the server. diff --git a/Swiften/Client/MemoryStorages.h b/Swiften/Client/MemoryStorages.h index e341a37..49f18f5 100644 --- a/Swiften/Client/MemoryStorages.h +++ b/Swiften/Client/MemoryStorages.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -20,7 +20,7 @@ namespace Swift { class SWIFTEN_API MemoryStorages : public Storages { public: MemoryStorages(CryptoProvider*); - ~MemoryStorages(); + virtual ~MemoryStorages(); virtual VCardStorage* getVCardStorage() const; virtual AvatarStorage* getAvatarStorage() const; diff --git a/Swiften/Client/NickManagerImpl.h b/Swiften/Client/NickManagerImpl.h index 9e599fa..51a8624 100644 --- a/Swiften/Client/NickManagerImpl.h +++ b/Swiften/Client/NickManagerImpl.h @@ -1,15 +1,16 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include #include #include -#include namespace Swift { class VCardManager; @@ -17,7 +18,7 @@ namespace Swift { class NickManagerImpl : public NickManager { public: NickManagerImpl(const JID& ownJID, VCardManager* vcardManager); - ~NickManagerImpl(); + virtual ~NickManagerImpl(); std::string getOwnNick() const; void setOwnNick(const std::string& nick); diff --git a/Swiften/Component/Component.h b/Swiften/Component/Component.h index c399645..9d8b5d3 100644 --- a/Swiften/Component/Component.h +++ b/Swiften/Component/Component.h @@ -1,14 +1,15 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include + namespace Swift { class SoftwareVersionResponder; @@ -21,7 +22,7 @@ namespace Swift { class SWIFTEN_API Component : public CoreComponent { public: Component(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); - ~Component(); + virtual ~Component(); /** * Sets the software version of the client. diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index 61571f2..12b38eb 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h @@ -1,28 +1,29 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include + #include #include -#include #include +#include +#include #include -#include #include -#include +#include +#include #include +#include +#include #include -#include #include #include -#include -#include -#include namespace Swift { class EventLoop; @@ -44,7 +45,7 @@ namespace Swift { class SWIFTEN_API CoreComponent : public Entity { public: CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); - ~CoreComponent(); + virtual ~CoreComponent(); void connect(const std::string& host, int port); void disconnect(); diff --git a/Swiften/Compress/ZLibCompressor.h b/Swiften/Compress/ZLibCompressor.h index b777505..c92b8c0 100644 --- a/Swiften/Compress/ZLibCompressor.h +++ b/Swiften/Compress/ZLibCompressor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -13,7 +13,7 @@ namespace Swift { class SWIFTEN_API ZLibCompressor : public ZLibCodecompressor { public: ZLibCompressor(); - ~ZLibCompressor(); + virtual ~ZLibCompressor(); virtual int processZStream(); diff --git a/Swiften/Compress/ZLibDecompressor.h b/Swiften/Compress/ZLibDecompressor.h index 07331ee..b758be3 100644 --- a/Swiften/Compress/ZLibDecompressor.h +++ b/Swiften/Compress/ZLibDecompressor.h @@ -1,19 +1,19 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include namespace Swift { class SWIFTEN_API ZLibDecompressor : public ZLibCodecompressor { public: ZLibDecompressor(); - ~ZLibDecompressor(); + virtual ~ZLibDecompressor(); virtual int processZStream(); }; diff --git a/Swiften/Crypto/WindowsCryptoProvider.cpp b/Swiften/Crypto/WindowsCryptoProvider.cpp index a6ae7a4..db4b2bf 100644 --- a/Swiften/Crypto/WindowsCryptoProvider.cpp +++ b/Swiften/Crypto/WindowsCryptoProvider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Isode Limited. + * Copyright (c) 2012-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -39,7 +39,7 @@ namespace { } } - ~WindowsHash() { + virtual ~WindowsHash() { CryptDestroyHash(hash); } diff --git a/Swiften/Crypto/WindowsCryptoProvider.h b/Swiften/Crypto/WindowsCryptoProvider.h index bd06b6e..b3f6f29 100644 --- a/Swiften/Crypto/WindowsCryptoProvider.h +++ b/Swiften/Crypto/WindowsCryptoProvider.h @@ -1,21 +1,22 @@ /* - * Copyright (c) 2013 Isode Limited. + * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include -#include #include #include +#include +#include + namespace Swift { class WindowsCryptoProvider : public CryptoProvider, public boost::noncopyable { public: WindowsCryptoProvider(); - ~WindowsCryptoProvider(); + virtual ~WindowsCryptoProvider(); virtual Hash* createSHA1() SWIFTEN_OVERRIDE; virtual Hash* createMD5() SWIFTEN_OVERRIDE; diff --git a/Swiften/FileTransfer/FileReadBytestream.h b/Swiften/FileTransfer/FileReadBytestream.h index 16748d3..5ea197e 100644 --- a/Swiften/FileTransfer/FileReadBytestream.h +++ b/Swiften/FileTransfer/FileReadBytestream.h @@ -1,13 +1,13 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { class SWIFTEN_API FileReadBytestream : public ReadBytestream { public: FileReadBytestream(const boost::filesystem::path& file); - ~FileReadBytestream(); + virtual ~FileReadBytestream(); virtual boost::shared_ptr< std::vector > read(size_t size); virtual bool isFinished() const; diff --git a/Swiften/FileTransfer/FileWriteBytestream.h b/Swiften/FileTransfer/FileWriteBytestream.h index 4621932..b2d3347 100644 --- a/Swiften/FileTransfer/FileWriteBytestream.h +++ b/Swiften/FileTransfer/FileWriteBytestream.h @@ -1,13 +1,13 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include #include #include @@ -16,7 +16,7 @@ namespace Swift { class SWIFTEN_API FileWriteBytestream : public WriteBytestream { public: FileWriteBytestream(const boost::filesystem::path& file); - ~FileWriteBytestream(); + virtual ~FileWriteBytestream(); virtual void write(const std::vector&); void close(); diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.h b/Swiften/FileTransfer/IncomingJingleFileTransfer.h index 9820e34..e30db5e 100644 --- a/Swiften/FileTransfer/IncomingJingleFileTransfer.h +++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.h @@ -50,7 +50,7 @@ namespace Swift { FileTransferTransporterFactory*, TimerFactory*, CryptoProvider*); - ~IncomingJingleFileTransfer(); + virtual ~IncomingJingleFileTransfer(); virtual void accept(boost::shared_ptr, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE; virtual void cancel() SWIFTEN_OVERRIDE; diff --git a/Swiften/Network/MiniUPnPInterface.h b/Swiften/Network/MiniUPnPInterface.h index 2f69e4b..46e45e5 100644 --- a/Swiften/Network/MiniUPnPInterface.h +++ b/Swiften/Network/MiniUPnPInterface.h @@ -1,13 +1,13 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #pragma once -#include #include +#include #include #include @@ -17,7 +17,7 @@ namespace Swift { class MiniUPnPInterface : public NATTraversalInterface, boost::noncopyable { public: MiniUPnPInterface(); - ~MiniUPnPInterface(); + virtual ~MiniUPnPInterface(); virtual bool isAvailable(); diff --git a/Swiften/Network/NATPMPInterface.h b/Swiften/Network/NATPMPInterface.h index f132ed5..467ee5c 100644 --- a/Swiften/Network/NATPMPInterface.h +++ b/Swiften/Network/NATPMPInterface.h @@ -1,14 +1,15 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #pragma once +#include #include #include -#include + #include #include @@ -16,7 +17,7 @@ namespace Swift { class NATPMPInterface : public NATTraversalInterface, boost::noncopyable { public: NATPMPInterface(); - ~NATPMPInterface(); + virtual ~NATPMPInterface(); virtual bool isAvailable(); diff --git a/Swiften/Network/PlatformNATTraversalWorker.h b/Swiften/Network/PlatformNATTraversalWorker.h index e9af651..2c03dca 100644 --- a/Swiften/Network/PlatformNATTraversalWorker.h +++ b/Swiften/Network/PlatformNATTraversalWorker.h @@ -4,19 +4,26 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include + +#include #include -#include -#include #include -#include +#include +#include #include #include -#include #include +#include #include namespace Swift { @@ -35,7 +42,7 @@ namespace Swift { public: PlatformNATTraversalWorker(EventLoop* eventLoop); - ~PlatformNATTraversalWorker(); + virtual ~PlatformNATTraversalWorker(); boost::shared_ptr createGetPublicIPRequest(); boost::shared_ptr createForwardPortRequest(int localPort, int publicPort); diff --git a/Swiften/Network/StaticDomainNameResolver.h b/Swiften/Network/StaticDomainNameResolver.h index 369a102..ebbc29f 100644 --- a/Swiften/Network/StaticDomainNameResolver.h +++ b/Swiften/Network/StaticDomainNameResolver.h @@ -1,21 +1,21 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include namespace Swift { class SWIFTEN_API StaticDomainNameResolver : public DomainNameResolver { @@ -25,7 +25,7 @@ namespace Swift { public: StaticDomainNameResolver(EventLoop* eventLoop); - ~StaticDomainNameResolver(); + virtual ~StaticDomainNameResolver(); void addAddress(const std::string& domain, const HostAddress& address); void addService(const std::string& service, const DomainNameServiceQuery::Result& result); diff --git a/Swiften/Network/UnixProxyProvider.h b/Swiften/Network/UnixProxyProvider.h index 37a4d05..4fc8b27 100644 --- a/Swiften/Network/UnixProxyProvider.h +++ b/Swiften/Network/UnixProxyProvider.h @@ -4,6 +4,12 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include @@ -14,7 +20,7 @@ namespace Swift { class UnixProxyProvider : public ProxyProvider { public: UnixProxyProvider(); - ~UnixProxyProvider(); + virtual ~UnixProxyProvider(); virtual HostAddressPort getHTTPConnectProxy() const; virtual HostAddressPort getSOCKS5Proxy() const; diff --git a/Swiften/Parser/LibXMLParser.h b/Swiften/Parser/LibXMLParser.h index a03ff71..c247548 100644 --- a/Swiften/Parser/LibXMLParser.h +++ b/Swiften/Parser/LibXMLParser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -19,7 +19,7 @@ namespace Swift { class LibXMLParser : public XMLParser, public boost::noncopyable { public: LibXMLParser(XMLParserClient* client); - ~LibXMLParser(); + virtual ~LibXMLParser(); bool parse(const std::string& data); diff --git a/Swiften/Parser/XMPPParser.h b/Swiften/Parser/XMPPParser.h index e8e0917..dcc98ca 100644 --- a/Swiften/Parser/XMPPParser.h +++ b/Swiften/Parser/XMPPParser.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include #include +#include #include -#include #include +#include namespace Swift { class XMLParser; @@ -26,7 +26,7 @@ namespace Swift { XMPPParserClient* parserClient, PayloadParserFactoryCollection* payloadParserFactories, XMLParserFactory* xmlParserFactory); - ~XMPPParser(); + virtual ~XMPPParser(); bool parse(const std::string&); diff --git a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h index f772b71..a249ba4 100644 --- a/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h +++ b/Swiften/SASL/WindowsGSSAPIClientAuthenticator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -22,7 +22,7 @@ namespace Swift { public: WindowsGSSAPIClientAuthenticator(const std::string& hostname, const std::string& domainname, int port); - ~WindowsGSSAPIClientAuthenticator(); + virtual ~WindowsGSSAPIClientAuthenticator(); virtual boost::optional getResponse() const; virtual bool setChallenge(const boost::optional >&); diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h index 6cdd5ab..35f5713 100644 --- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h +++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -15,7 +15,7 @@ namespace Swift { class SWIFTEN_API FullPayloadSerializerCollection : public PayloadSerializerCollection { public: FullPayloadSerializerCollection(); - ~FullPayloadSerializerCollection(); + virtual ~FullPayloadSerializerCollection(); private: std::vector serializers_; diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h index 811374a..2298351 100644 --- a/Swiften/Session/BasicSessionStream.h +++ b/Swiften/Session/BasicSessionStream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,9 +10,9 @@ #include #include +#include #include #include -#include #include #include @@ -41,7 +41,7 @@ namespace Swift { XMLParserFactory* xmlParserFactory, const TLSOptions& tlsOptions ); - ~BasicSessionStream(); + virtual ~BasicSessionStream(); virtual void close(); virtual bool isOpen(); diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h index afefca7..1bf145d 100644 --- a/Swiften/StreamStack/XMPPLayer.h +++ b/Swiften/StreamStack/XMPPLayer.h @@ -1,21 +1,21 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include -#include #include +#include #include -#include #include -#include +#include #include +#include #include +#include namespace Swift { class ProtocolHeader; @@ -35,7 +35,7 @@ namespace Swift { XMLParserFactory* xmlParserFactory, StreamType streamType, bool setExplictNSonTopLevelElements = false); - ~XMPPLayer(); + virtual ~XMPPLayer(); void writeHeader(const ProtocolHeader& header); void writeFooter(); -- cgit v0.10.2-6-g49f6