Don't leak binaryBlob

This commit is contained in:
leo60228 authored and Ethan Lee committed 2020-06-07 22:40:03 -04:00
1 parent 9b91047bba
commit f3b26904ec
4 files changed
+19 -1

No files matched your search

+12
View File
@@ -123,6 +123,18 @@ bool binaryBlob::unPackBinary(const char* name)
return true;
}
void binaryBlob::clear()
{
for (int i = 0; i < 128; i += 1)
{
if (m_headers[i].valid)
{
free(m_memblocks[i]);
m_headers[i].valid = false;
}
}
}
int binaryBlob::getIndex(const char* _name)
{
for (int i = 0; i < 128; i += 1)