From 2e31cf3258090fb73bf8a71642c4dedc47281919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 12 Apr 2020 17:12:20 +0200 Subject: [PATCH] delete incomplete map file when download is aborted (cherry picked from commit github.com/teeworlds/teeworlds/commit/494f74902dcb0271235d3a0831ecd4c6db58b7e9) --- src/engine/client/client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index ff5f9ec82..d12f5c926 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -801,7 +801,10 @@ void CClient::DisconnectWithReason(const char *pReason) if(m_pMapdownloadTask) m_pMapdownloadTask->Abort(); if(m_MapdownloadFile) + { io_close(m_MapdownloadFile); + Storage()->RemoveFile(m_aMapdownloadFilename, IStorage::TYPE_SAVE); + } m_MapdownloadFile = 0; m_MapdownloadSha256Present = false; m_MapdownloadSha256 = SHA256_ZEROED;