From f89933bb46d504dcfaa620e4d06e6407b524a4a5 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 28 Dec 2019 12:46:17 +0800 Subject: [PATCH] Exit the loop earlier if protocol manager is exiting --- src/network/protocols/connect_to_server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/protocols/connect_to_server.cpp b/src/network/protocols/connect_to_server.cpp index 305c384a0..b1860065d 100644 --- a/src/network/protocols/connect_to_server.cpp +++ b/src/network/protocols/connect_to_server.cpp @@ -113,7 +113,8 @@ void ConnectToServer::getClientServerInfo() const std::string server_id_file = StringUtils::getBasename(sid); uint16_t port = 0; unsigned server_id = 0; - while (StkTime::getMonoTimeMs() < timeout) + while (!ProtocolManager::lock()->isExiting() && + StkTime::getMonoTimeMs() < timeout) { std::set files; file_manager->listFiles(files, dir);