1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix crash on closing client while server is active

This commit is contained in:
Ivan Savenko 2024-02-12 16:36:13 +02:00
parent 763e18d202
commit 74f9b03516

View File

@ -108,9 +108,14 @@ public:
CServerHandler::~CServerHandler()
{
if (serverRunner)
serverRunner->shutdown();
networkHandler->stop();
try
{
if (serverRunner)
serverRunner->wait();
serverRunner.reset();
threadNetwork.join();
}
catch (const std::runtime_error & e)