diff --git a/Source/IO/FS/FileStream.NT.cpp b/Source/IO/FS/FileStream.NT.cpp index 2786f166..40311d3a 100644 --- a/Source/IO/FS/FileStream.NT.cpp +++ b/Source/IO/FS/FileStream.NT.cpp @@ -210,7 +210,7 @@ namespace Aurora::IO::FS auto uBlockSize = AuMin(AuUInt(kFileCopyBlock), uLength); - if (this->pHandle_->IsAsync()) + if (bIsAsync) { OVERLAPPED overlapped {}; overlapped.hEvent = hEventHandle; @@ -242,7 +242,6 @@ namespace Aurora::IO::FS if (!::WriteFile(hHandle, reinterpret_cast(parameters.ptr) + uOffset, uBlockSize, &written, NULL)) { SysPushErrorIO("WriteFile IO Error: 0x{:x}, {}", GetLastError(), this->pHandle_ ? this->pHandle_->GetPath() : ""); - AuWin32CloseHandle(hEventHandle); parameters.outVariable = uOffset; return false; }