fix for small memory leaks
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@562 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
50e327024e
commit
f198d550bc
|
@ -102,7 +102,11 @@ void* AllocateMemoryPages(int size)
|
||||||
void FreeMemoryPages(void* ptr, int size)
|
void FreeMemoryPages(void* ptr, int size)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
VirtualFree(ptr, 0, MEM_RELEASE);
|
VirtualFree(ptr, 0, MEM_RELEASE);
|
||||||
|
ptr = NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
munmap(ptr, size);
|
munmap(ptr, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,6 +65,8 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
|
||||||
bkeepLooping = FindNextFile(FindFirst, &findData) ? true : false;
|
bkeepLooping = FindNextFile(FindFirst, &findData) ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FindClose(FindFirst);
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
size_t dot_pos = _searchString.rfind(".");
|
size_t dot_pos = _searchString.rfind(".");
|
||||||
|
|
|
@ -373,7 +373,7 @@ void OpcodeDecoder_Init()
|
||||||
|
|
||||||
void OpcodeDecoder_Shutdown()
|
void OpcodeDecoder_Shutdown()
|
||||||
{
|
{
|
||||||
//VirtualFree((LPVOID)buffer,CMDBUFFER_SIZE,MEM_RELEASE);
|
//VirtualFree((LPVOID)buffer,0,MEM_RELEASE);
|
||||||
tempvarray.Destroy();
|
tempvarray.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,9 +68,12 @@ void TextureCache::Shutdown()
|
||||||
{
|
{
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
|
if (temp != NULL)
|
||||||
|
{
|
||||||
VirtualFree(temp, 0, MEM_RELEASE);
|
VirtualFree(temp, 0, MEM_RELEASE);
|
||||||
temp = NULL;
|
temp = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TextureCache::Cleanup()
|
void TextureCache::Cleanup()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue