Skip to content

Commit

Permalink
Revert "Unconditionally free and zero in binaryBlob::clear()"
Browse files Browse the repository at this point in the history
This reverts commit bd97378.

Again, SDL_zeroa()
  • Loading branch information
Daaaav committed Feb 16, 2021
1 parent 80e165b commit 8791ec8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions desktop_version/src/BinaryBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ void binaryBlob::clear()
{
for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1)
{
SDL_free(m_memblocks[i]);
if (m_headers[i].valid)
{
SDL_free(m_memblocks[i]);
m_headers[i].valid = false;
}
}
SDL_zeroa(m_memblocks);
SDL_zeroa(m_headers);
}

int binaryBlob::getIndex(const char* _name)
Expand Down

0 comments on commit 8791ec8

Please sign in to comment.