Fixed assertion when manually closing a filestream.
This commit is contained in:
parent
24033dbfcc
commit
6ebcb96444
@ -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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user