Browse Source

fix to early remove of iterator in VNCServerST::removeSocket

tags/v1.9.90
Benoit Gschwind 4 years ago
parent
commit
8e09912f9d
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      common/rfb/VNCServerST.cxx

+ 2
- 2
common/rfb/VNCServerST.cxx View File

@@ -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);

Loading…
Cancel
Save