Prevent leak of SecurityServer and ClientServer.
They are created in SConnection's and CConnection's constructors but never destroyed.
There is no reason for the indirection, so lets make them direct members.
diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h
index 799a9c2..e0a000f 100644
--- a/common/rfb/CConnection.h
+++ b/common/rfb/CConnection.h
@@ -26,6 +26,7 @@
#include <rfb/CMsgHandler.h>
#include <rfb/DecodeManager.h>
+#include <rfb/SecurityClient.h>
#include <rfb/util.h>
namespace rfb {
@@ -34,7 +35,6 @@
class CMsgWriter;
class CSecurity;
class IdentityVerifier;
- class SecurityClient;
class CConnection : public CMsgHandler {
public:
@@ -148,7 +148,7 @@
stateEnum state() { return state_; }
CSecurity *csecurity;
- SecurityClient *security;
+ SecurityClient security;
protected:
void setState(stateEnum s) { state_ = s; }