diff options
| author | fires.gc <fires.gc@gmail.com> | 2008-09-17 08:40:52 +0000 |
|---|---|---|
| committer | fires.gc <fires.gc@gmail.com> | 2008-09-17 08:40:52 +0000 |
| commit | f198d550bc93256fea8301f11455a72b87c06d0d (patch) | |
| tree | a66e9cf46ff9acc75eac9e118aae50186e88f5f5 /Source/Core/Common/Src/MemoryUtil.cpp | |
| parent | 50e327024ea8c0fad214bc7708c0a14b0f10ef5a (diff) | |
fix for small memory leaks
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@562 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/MemoryUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/MemoryUtil.cpp | 6 |
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
|
