diff --git a/ixwebsocket/IXSocketServer.cpp b/ixwebsocket/IXSocketServer.cpp index 63b2ed1f..eb8d8ed6 100644 --- a/ixwebsocket/IXSocketServer.cpp +++ b/ixwebsocket/IXSocketServer.cpp @@ -181,14 +181,13 @@ namespace ix auto& connectionState = it->first; auto& thread = it->second; - if (!connectionState->isTerminated() || - !thread.joinable()) + if (!connectionState->isTerminated()) { ++it; continue; } - thread.join(); + if (thread.joinable()) thread.join(); it = _connectionsThreads.erase(it); } }