From e5937638d44f31955afb992dce2ad08781708651 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Tue, 1 Jan 2019 16:14:46 -0800 Subject: [PATCH] crash when server failed to start --- ixwebsocket/IXWebSocketServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ixwebsocket/IXWebSocketServer.cpp b/ixwebsocket/IXWebSocketServer.cpp index 996fa497..3778f09e 100644 --- a/ixwebsocket/IXWebSocketServer.cpp +++ b/ixwebsocket/IXWebSocketServer.cpp @@ -130,6 +130,8 @@ namespace ix // FIXME: we should cancel all the async per connections tasks void WebSocketServer::stop() { + if (!_thread.joinable()) return; // nothing to do + _stop = true; _thread.join(); _stop = false;