From dd9899c34bb1f86caf486735b136a5460b4760db Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Mon, 24 Sep 2012 07:47:14 -0500 Subject: [PATCH] Adds virtual destructors to handler interfaces fixes #136 --- src/roles/client.hpp | 2 ++ src/roles/server.hpp | 2 ++ src/sockets/plain.hpp | 2 ++ src/sockets/tls.hpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/roles/client.hpp b/src/roles/client.hpp index b0202239ef..494765c8d9 100644 --- a/src/roles/client.hpp +++ b/src/roles/client.hpp @@ -187,6 +187,8 @@ public: // handler interface callback class class handler_interface { public: + virtual ~handler_interface() {} + // Required virtual void on_open(connection_ptr con) {} virtual void on_close(connection_ptr con) {} diff --git a/src/roles/server.hpp b/src/roles/server.hpp index aefb36e75f..48c445378c 100644 --- a/src/roles/server.hpp +++ b/src/roles/server.hpp @@ -174,6 +174,8 @@ public: // handler interface callback base class class handler_interface { public: + virtual ~handler_interface() {} + virtual void on_handshake_init(connection_ptr con) {} virtual void validate(connection_ptr con) {} diff --git a/src/sockets/plain.hpp b/src/sockets/plain.hpp index 376fcb3bee..201d86c249 100644 --- a/src/sockets/plain.hpp +++ b/src/sockets/plain.hpp @@ -52,6 +52,8 @@ public: // hooks that this policy adds to handlers of connections that use it class handler_interface { public: + virtual ~handler_interface() {} + virtual void on_tcp_init() {}; }; diff --git a/src/sockets/tls.hpp b/src/sockets/tls.hpp index da28415c68..1cdbf40c2f 100644 --- a/src/sockets/tls.hpp +++ b/src/sockets/tls.hpp @@ -69,6 +69,8 @@ public: // to set up their asio TLS context. class handler_interface { public: + virtual ~handler_interface() {} + virtual void on_tcp_init() {}; virtual boost::shared_ptr on_tls_init() = 0; };