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); }