mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #22344 from hrydgard/download-cancel-at-exit
Don't crash at exit with a download still in flight
This commit is contained in:
4 files changed
+18
No files matched your search
@@ -168,6 +168,11 @@ restart:
|
||||
}
|
||||
|
||||
void RequestManager::CancelAll() {
|
||||
// Including ones started since the last Update (headless never calls it).
|
||||
for (auto &iter : newDownloads_) {
|
||||
downloads_.push_back(iter);
|
||||
}
|
||||
newDownloads_.clear();
|
||||
for (size_t i = 0; i < downloads_.size(); i++) {
|
||||
downloads_[i]->Cancel();
|
||||
}
|
||||
|
||||
@@ -660,6 +660,12 @@ void __NetApctlShutdown() {
|
||||
}
|
||||
|
||||
void __NetShutdown() {
|
||||
// A Netconf dialog may have started the json download. Don't leave it running past us.
|
||||
if (g_infraDL) {
|
||||
g_infraDL->Cancel();
|
||||
g_infraDL.reset();
|
||||
}
|
||||
|
||||
// Network Cleanup
|
||||
Net_Term();
|
||||
|
||||
|
||||
@@ -1862,6 +1862,9 @@ void NativeShutdown() {
|
||||
|
||||
__UPnPShutdown();
|
||||
|
||||
// A request finishing while globals are destroyed at exit touches g_OSD, which may be gone by then.
|
||||
g_DownloadManager.CancelAll();
|
||||
|
||||
net::Shutdown();
|
||||
|
||||
g_Discord.Shutdown();
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "Common/Thread/ThreadManager.h"
|
||||
#include "Common/GPU/Vulkan/VulkanGraphicsContext.h"
|
||||
#include "Core/CmdLine.h"
|
||||
#include "Common/Net/HTTPRequest.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
#include "Core/Core.h"
|
||||
@@ -1185,6 +1186,9 @@ int main(int argc, const char* argv[]) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// A request finishing while globals are destroyed at exit touches g_OSD, which may be gone by then.
|
||||
g_DownloadManager.CancelAll();
|
||||
|
||||
g_VFS.Clear();
|
||||
g_logManager.Shutdown();
|
||||
if (cmdLineOptions.DebuggerPort().has_value()) {
|
||||
|
||||
Reference in new issue
Block a user