Exit the loop earlier if protocol manager is exiting

This commit is contained in:
Benau 2019-12-28 12:46:17 +08:00
parent 3944d81cfc
commit f89933bb46

View File

@ -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<std::string> files;
file_manager->listFiles(files, dir);