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.cxx b/common/rfb/CConnection.cxx
index 2020418..88befd5 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -44,7 +44,6 @@
state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false),
framebuffer(NULL), decoder(this)
{
- security = new SecurityClient();
}
CConnection::~CConnection()
@@ -167,7 +166,7 @@
int secType = secTypeInvalid;
std::list<rdr::U8> secTypes;
- secTypes = security->GetEnabledSecTypes();
+ secTypes = security.GetEnabledSecTypes();
if (cp.isVersion(3,3)) {
@@ -235,7 +234,7 @@
}
state_ = RFBSTATE_SECURITY;
- csecurity = security->GetCSecurity(secType);
+ csecurity = security.GetCSecurity(secType);
processSecurityMsg();
}