diff options
Diffstat (limited to 'common/rfb/CConnection.cxx')
-rw-r--r-- | common/rfb/CConnection.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index bdde3253..f541a969 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -60,14 +60,7 @@ CConnection::CConnection() CConnection::~CConnection() { - setFramebuffer(NULL); - if (csecurity) - delete csecurity; - delete reader_; - reader_ = 0; - delete writer_; - writer_ = 0; - strFree(serverClipboard); + close(); } void CConnection::setStreams(rdr::InStream* is_, rdr::OutStream* os_) @@ -336,6 +329,21 @@ void CConnection::securityCompleted() writer_->writeClientInit(shared); } +void CConnection::close() +{ + state_ = RFBSTATE_CLOSING; + + setFramebuffer(NULL); + delete csecurity; + csecurity = NULL; + delete reader_; + reader_ = NULL; + delete writer_; + writer_ = NULL; + strFree(serverClipboard); + serverClipboard = NULL; +} + void CConnection::setDesktopSize(int w, int h) { decoder.flush(); |