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 53f957e..874a59c 100644
--- a/common/network/Socket.h
+++ b/common/network/Socket.h
@@ -82,6 +82,7 @@
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 5d9598c..b4c8765 100644
--- a/common/rdr/FdInStream.h
+++ b/common/rdr/FdInStream.h
@@ -30,6 +30,7 @@
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 2c08c24..4bf42b7 100644
--- a/common/rfb/SSecurityPlain.h
+++ b/common/rfb/SSecurityPlain.h
@@ -38,6 +38,8 @@
{ 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 @@
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 e9f379b..a1d1747 100644
--- a/common/rfb/SSecurityVncAuth.h
+++ b/common/rfb/SSecurityVncAuth.h
@@ -37,6 +37,8 @@
// 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 e295b82..78687d1 100644
--- a/common/rfb/Timer.h
+++ b/common/rfb/Timer.h
@@ -49,6 +49,8 @@
// 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 18b0bae..aa72c1d 100644
--- a/common/rfb/UserPasswdGetter.h
+++ b/common/rfb/UserPasswdGetter.h
@@ -25,6 +25,8 @@
// 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