From 573aab4bdb57fe81ba8da3dc1bdac967b5317491 Mon Sep 17 00:00:00 2001 From: "Jean-Luc T." <88255067+Jean-LucTch@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:41:07 +0200 Subject: [PATCH] Add cleanup of stale temporary files before download Remove stale temporary files before downloading. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- Engine/Vfs/https_download.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/Vfs/https_download.cpp b/Engine/Vfs/https_download.cpp index d5f79a3a..6ccb6b20 100644 --- a/Engine/Vfs/https_download.cpp +++ b/Engine/Vfs/https_download.cpp @@ -197,6 +197,7 @@ std::optional get_text(std::wstring_view url, std::uint64_t max_byt const auto path = std::filesystem::path(length ? std::wstring(folder, length) : L".") / (L"reskate-get-" + std::to_wstring(GetCurrentProcessId()) + L"-" + std::to_wstring(++serial) + L".tmp"); std::error_code error; +std::filesystem::remove(path, error); // discard a stale file left by an earlier process const auto download = get(url, path, max_bytes, timeout_seconds, agent, watch); if (result) *result = download; std::optional text;