diff --git a/src/main.cpp b/src/main.cpp index 1a878b70f..fc3757dfa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2356,11 +2356,14 @@ static void cleanSuperTuxKart() } #endif - if(!Online::RequestManager::get()->waitForReadyToDeleted(5.0f)) + if (Online::RequestManager::get()->waitForReadyToDeleted(5.0f)) { - Log::info("Thread", "Request Manager not aborting in time, aborting."); + Online::RequestManager::deallocate(); + } + else + { + Log::warn("Thread", "Request Manager not aborting in time, proceeding without cleanup."); } - Online::RequestManager::deallocate(); if (!SFXManager::get()->waitForReadyToDeleted(2.0f)) { diff --git a/src/online/request_manager.cpp b/src/online/request_manager.cpp index fb19a633a..12278c1b8 100644 --- a/src/online/request_manager.cpp +++ b/src/online/request_manager.cpp @@ -165,7 +165,8 @@ namespace Online */ void RequestManager::addRequest(Request *request) { - if (UserConfigParams::m_internet_status == RequestManager::IPERM_NOT_ALLOWED) + if (UserConfigParams::m_internet_status == RequestManager::IPERM_NOT_ALLOWED + && request->getType() != Request::RT_QUIT) { Log::error("RequestManager", "addRequest called, but internet connections are forbidden"); return; diff --git a/src/states_screens/options/options_screen_general.cpp b/src/states_screens/options/options_screen_general.cpp index 4f354ba2c..89dc90d52 100644 --- a/src/states_screens/options/options_screen_general.cpp +++ b/src/states_screens/options/options_screen_general.cpp @@ -156,8 +156,13 @@ void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name // If internet is being activated, enable immediately. If it's being disabled, // we'll disable later after logout. if (internet->getState()) + { UserConfigParams::m_internet_status = RequestManager::IPERM_ALLOWED; + if (!RequestManager::isRunning()) + RequestManager::get()->startNetworkThread(); + } + // If internet gets enabled, re-initialise the addon manager (which // happens in a separate thread) so that news.xml etc can be // downloaded if necessary. @@ -188,7 +193,10 @@ void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name // Deactivate internet after 'requestSignOut' so that the sign out request is allowed if (!internet->getState()) + { UserConfigParams::m_internet_status = RequestManager::IPERM_NOT_ALLOWED; + RequestManager::get()->stopNetworkThread(); + } } else if (name=="enable-hw-report") {