Exit server stk process if STKHost no longer exists

This commit is contained in:
Benau 2019-12-06 12:03:18 +08:00
parent 11b9897f88
commit d60b087c25

View File

@ -414,6 +414,8 @@ void MainLoop::run()
// Shutdown next frame if shutdown request is sent while loading the
// world
bool was_server = NetworkConfig::get()->isNetworking() &&
NetworkConfig::get()->isServer();
if ((STKHost::existHost() && STKHost::get()->requestedShutdown()) ||
m_request_abort)
{
@ -467,7 +469,6 @@ void MainLoop::run()
NetworkConfig::get()->getResetScreens().data());
MessageQueue::add(MessageQueue::MT_ERROR, msg);
}
NetworkConfig::get()->unsetNetworking();
}
@ -477,6 +478,9 @@ void MainLoop::run()
}
}
if (was_server && !STKHost::existHost())
m_abort = true;
if (!m_abort)
{
float frame_duration = num_steps * dt;