aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/iobuffer.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-19 12:06:13 +0100
committerGitHub <[email protected]>2023-12-19 12:06:13 +0100
commit519d942d809e740a3b1fe5a1f6a57a4cfe43408b (patch)
tree9b3c084e21bb7fd5e6bb3335e890647062d0703b /src/zencore/iobuffer.cpp
parentadded mimalloc_hooks (diff)
parentensure we can build without trace (#619) (diff)
downloadzen-273-integrated-memory-tracking.tar.xz
zen-273-integrated-memory-tracking.zip
Merge branch 'main' into 273-integrated-memory-tracking273-integrated-memory-tracking
Diffstat (limited to 'src/zencore/iobuffer.cpp')
-rw-r--r--src/zencore/iobuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp
index 912f9ce4e..80d0f4ee4 100644
--- a/src/zencore/iobuffer.cpp
+++ b/src/zencore/iobuffer.cpp
@@ -209,6 +209,8 @@ IoBufferExtendedCore::~IoBufferExtendedCore()
uint64_t MapSize = ~uint64_t(uintptr_t(m_MmapHandle));
munmap(m_MappedPointer, MapSize);
#endif
+
+ m_DataPtr = nullptr; // prevent any buffer deallocation attempts
}
const uint32_t LocalFlags = m_Flags.load(std::memory_order_relaxed);
@@ -244,8 +246,6 @@ IoBufferExtendedCore::~IoBufferExtendedCore()
ZEN_WARN("Error reported on file handle close, reason '{}'", GetLastErrorAsString());
}
}
-
- m_DataPtr = nullptr;
}
static constexpr size_t MappingLockCount = 128;