aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zencore/iobuffer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp
index 2522daf35..d037d7a85 100644
--- a/zencore/iobuffer.cpp
+++ b/zencore/iobuffer.cpp
@@ -350,10 +350,11 @@ IoBufferExtendedCore::Materialize() const
if (MappedBase == nullptr)
{
+ int32_t Error = zen::GetLastError();
#if ZEN_PLATFORM_WINDOWS
CloseHandle(NewMmapHandle);
#endif // ZEN_PLATFORM_WINDOWS
- throw std::system_error(std::error_code(zen::GetLastError(), std::system_category()),
+ throw std::system_error(std::error_code(Error, std::system_category()),
fmt::format("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}'",
MapOffset,
MapSize,