From ba5fe7b17e387a4f4bb92d10a4ecf7f57b7454fe Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Thu, 1 Apr 2021 18:32:40 +0200 Subject: munmap as well --- src/FileStream.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/FileStream.cpp') diff --git a/src/FileStream.cpp b/src/FileStream.cpp index bfb5817..7268923 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -631,14 +631,17 @@ static bool BaseMap_Read( static void BaseMap_Close(TFileStream * pStream) { + #ifdef STORMLIB_WINDOWS + if(pStream->Base.Map.pbFile != NULL) UnmapViewOfFile(pStream->Base.Map.pbFile); -#endif -#if defined(STORMLIB_MAC) || defined(STORMLIB_LINUX) +#elif defined(STORMLIB_HAS_MMAP) + if(pStream->Base.Map.pbFile != NULL) munmap(pStream->Base.Map.pbFile, (size_t )pStream->Base.Map.FileSize); + #endif pStream->Base.Map.pbFile = NULL; -- cgit v1.2.3