Fix custom models and fix some memory leaks nta had

This commit is contained in:
momo5502
2016-09-19 20:18:36 +02:00
parent 23570ee64d
commit 83d6ab2d6b
6 changed files with 69 additions and 535 deletions

View File

@ -27,6 +27,7 @@ namespace Utils
{
if (data)
{
OutputDebugStringA(Utils::String::VA("Free: %X\n", (DWORD)data));
free(data);
}
}
@ -36,6 +37,19 @@ namespace Utils
Memory::Free(const_cast<void*>(data));
}
void Memory::FreeAlign(void* data)
{
if (data)
{
_aligned_free(data);
}
}
void Memory::FreeAlign(const void* data)
{
Memory::FreeAlign(const_cast<void*>(data));
}
// Complementary function for memset, which checks if memory is filled with a char
bool Memory::IsSet(void* mem, char chr, size_t length)
{

View File

@ -108,6 +108,9 @@ namespace Utils
static void Free(void* data);
static void Free(const void* data);
static void FreeAlign(void* data);
static void FreeAlign(const void* data);
static bool IsSet(void* mem, char chr, size_t length);
};
}