summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/rfb/VNCServerST.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index a3655bca..a764f1bc 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -165,8 +165,6 @@ void VNCServerST::removeSocket(network::Socket* sock) {
std::list<VNCSConnectionST*>::iterator ci;
for (ci = clients.begin(); ci != clients.end(); ci++) {
if ((*ci)->getSock() == sock) {
- clients.remove(*ci);
-
// - Remove any references to it
if (pointerClient == *ci)
pointerClient = NULL;
@@ -182,6 +180,8 @@ void VNCServerST::removeSocket(network::Socket* sock) {
// - Delete the per-Socket resources
delete *ci;
+ clients.remove(*ci);
+
CharArray name;
name.buf = sock->getPeerEndpoint();
connectionsLog.status("closed: %s", name.buf);