Avoid hanging if exit connecting to server

This commit is contained in:
Benau 2019-07-26 18:25:39 +08:00
parent 504e2b8cbf
commit 87b515ee75

View File

@ -386,7 +386,7 @@ void STKHost::setPublicAddress()
std::shuffle(untried_server.begin() + (untried_server.size() / 2),
untried_server.end(), g);
while (!untried_server.empty())
while (!untried_server.empty() && !ProtocolManager::lock()->isExiting())
{
// Pick last element in untried servers
std::string server_name = untried_server.back().first.c_str();