From: Steve Kondik Date: Sat, 8 Jul 2017 08:49:14 +0000 (-0700) Subject: Add missing virtual destructors X-Git-Tag: v1.8.90~112^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a6424624feda6f473e49f45f8c4bc32e3523c9e0;p=tigervnc.git Add missing virtual destructors Fix warnings emitted by Clang: /home/shade/dev/tigervnc/common/rdr/FdInStream.h:30:9: error: 'rdr::FdInStreamBlockCallback' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class FdInStreamBlockCallback { ^ In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.cxx:44: In file included from /home/shade/dev/tigervnc/common/network/TcpSocket.h:31: /home/shade/dev/tigervnc/common/network/Socket.h:82:9: error: 'network::ConnectionFilter' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor] class ConnectionFilter { ^ ..etc --- diff --git a/common/network/Socket.h b/common/network/Socket.h index 53f957e6..874a59cd 100644 --- a/common/network/Socket.h +++ b/common/network/Socket.h @@ -82,6 +82,7 @@ namespace network { class ConnectionFilter { public: virtual bool verifyConnection(Socket* s) = 0; + virtual ~ConnectionFilter() {} }; class SocketListener { diff --git a/common/rdr/FdInStream.h b/common/rdr/FdInStream.h index 5d9598c8..b4c87653 100644 --- a/common/rdr/FdInStream.h +++ b/common/rdr/FdInStream.h @@ -30,6 +30,7 @@ namespace rdr { class FdInStreamBlockCallback { public: virtual void blockCallback() = 0; + virtual ~FdInStreamBlockCallback() {} }; class FdInStream : public InStream { diff --git a/common/rfb/SSecurityPlain.h b/common/rfb/SSecurityPlain.h index 2c08c24e..4bf42b74 100644 --- a/common/rfb/SSecurityPlain.h +++ b/common/rfb/SSecurityPlain.h @@ -38,6 +38,8 @@ namespace rfb { { return validUser(username) ? validateInternal(sc, username, password) : false; } static StringParameter plainUsers; + virtual ~PasswordValidator() { } + protected: virtual bool validateInternal(SConnection* sc, const char *username, const char *password)=0; static bool validUser(const char* username); @@ -50,6 +52,8 @@ namespace rfb { virtual int getType() const { return secTypePlain; }; virtual const char* getUserName() const { return username.buf; } + virtual ~SSecurityPlain() { } + private: PasswordValidator* valid; unsigned int ulen, plen, state; diff --git a/common/rfb/SSecurityVncAuth.h b/common/rfb/SSecurityVncAuth.h index e9f379ba..a1d17472 100644 --- a/common/rfb/SSecurityVncAuth.h +++ b/common/rfb/SSecurityVncAuth.h @@ -37,6 +37,8 @@ namespace rfb { // getVncAuthPasswd() fills buffer of given password and readOnlyPassword. // If there was no read only password in the file, readOnlyPassword buffer is null. virtual void getVncAuthPasswd(PlainPasswd *password, PlainPasswd *readOnlyPassword)=0; + + virtual ~VncAuthPasswdGetter() { } }; class VncAuthPasswdParameter : public VncAuthPasswdGetter, BinaryParameter { diff --git a/common/rfb/Timer.h b/common/rfb/Timer.h index e295b826..78687d1a 100644 --- a/common/rfb/Timer.h +++ b/common/rfb/Timer.h @@ -49,6 +49,8 @@ namespace rfb { // appropriate interval. // If the handler returns false then the Timer is cancelled. virtual bool handleTimeout(Timer* t) = 0; + + virtual ~Callback() {} }; // checkTimeouts() diff --git a/common/rfb/UserPasswdGetter.h b/common/rfb/UserPasswdGetter.h index 18b0bae3..aa72c1dd 100644 --- a/common/rfb/UserPasswdGetter.h +++ b/common/rfb/UserPasswdGetter.h @@ -25,6 +25,8 @@ namespace rfb { // case no user name will be retrieved. The caller MUST delete [] the // result(s). virtual void getUserPasswd(char** user, char** password)=0; + + virtual ~UserPasswdGetter() {} }; } #endif