From fe4260e8f0ff170cc804a0f5fe9422eeec51cdd5 Mon Sep 17 00:00:00 2001 From: The Arrayser <68914060+TheArrayser@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:41:13 +0200 Subject: [PATCH] null --- System Abstraction/win32/cdb_file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/System Abstraction/win32/cdb_file.c b/System Abstraction/win32/cdb_file.c index 8c31f43..a819281 100644 --- a/System Abstraction/win32/cdb_file.c +++ b/System Abstraction/win32/cdb_file.c @@ -118,10 +118,12 @@ void * sus_fileFileToMemroy(sus_File file){ } void sus_fileClose(sus_File file){ - FlushViewOfFile(file->memroy, 0); - UnmapViewOfFile(file->memroy); - CloseHandle(file->fileMapHandle); - CloseHandle(file->fileHandle); + if(file->memroy == NULL){ + FlushViewOfFile(file->memroy, 0); + UnmapViewOfFile(file->memroy); + CloseHandle(file->fileMapHandle); + CloseHandle(file->fileHandle); + } sus_heapFree(file); }