From d60b087c259d0a97b12f29cd34f69acacb516b7d Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 6 Dec 2019 12:03:18 +0800 Subject: [PATCH] Exit server stk process if STKHost no longer exists --- src/main_loop.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main_loop.cpp b/src/main_loop.cpp index 1e0c9d919..ca71e0480 100644 --- a/src/main_loop.cpp +++ b/src/main_loop.cpp @@ -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;