Don't leak binaryBlob

This commit is contained in:
leo60228
2020-06-07 16:11:35 -04:00
committed by Ethan Lee
parent 9b91047bba
commit f3b26904ec
4 changed files with 19 additions and 1 deletions

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)