summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/MemoryUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/MemoryUtil.cpp')
-rw-r--r--Source/Core/Common/Src/MemoryUtil.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/MemoryUtil.cpp b/Source/Core/Common/Src/MemoryUtil.cpp
index 23f8457dec..0099158872 100644
--- a/Source/Core/Common/Src/MemoryUtil.cpp
+++ b/Source/Core/Common/Src/MemoryUtil.cpp
@@ -102,7 +102,11 @@ void* AllocateMemoryPages(int size)
void FreeMemoryPages(void* ptr, int size)
{
#ifdef _WIN32
- VirtualFree(ptr, 0, MEM_RELEASE);
+ if (ptr)
+ {
+ VirtualFree(ptr, 0, MEM_RELEASE);
+ ptr = NULL;
+ }
#else
munmap(ptr, size);
#endif