diff --git a/win-linux/extras/update-daemon/src/classes/cdownloader.cpp b/win-linux/extras/update-daemon/src/classes/cdownloader.cpp index d6c42894a..f3440d02c 100644 --- a/win-linux/extras/update-daemon/src/classes/cdownloader.cpp +++ b/win-linux/extras/update-daemon/src/classes/cdownloader.cpp @@ -149,8 +149,11 @@ int downloadToFile(const wstring &url, const wstring &filePath, std::atomic_bool } while (dwSize > 0); cleanup : - if (hFile != INVALID_HANDLE_VALUE) + if (hFile != INVALID_HANDLE_VALUE) { CloseHandle(hFile); + if (result == DNL_ABORT) + DeleteFile(filePath.c_str()); + } WinHttpCloseHandle(hRequest); WinHttpCloseHandle(hConnect); WinHttpCloseHandle(hSession);