Fixed assertion when manually closing a filestream.

This commit is contained in:
Patrick 2024-09-19 14:10:11 +02:00
parent 24033dbfcc
commit 6ebcb96444

View File

@ -371,6 +371,7 @@ void FileStream::close()
MIJIN_ASSERT(handle != nullptr, "FileStream is not open."); MIJIN_ASSERT(handle != nullptr, "FileStream is not open.");
const int result = std::fclose(handle); // NOLINT(cppcoreguidelines-owning-memory) const int result = std::fclose(handle); // NOLINT(cppcoreguidelines-owning-memory)
MIJIN_ASSERT(result == 0, "fclose failed."); MIJIN_ASSERT(result == 0, "fclose failed.");
handle = nullptr;
} }
StreamError FileStream::readRaw(std::span<std::uint8_t> buffer, const ReadOptions& options, std::size_t* outBytesRead) StreamError FileStream::readRaw(std::span<std::uint8_t> buffer, const ReadOptions& options, std::size_t* outBytesRead)