free_file_line no longer complains about NULL free's not existing.

Removed unnecessary checks for NULL that were added due to the
previous problem.
This commit is contained in:
Aaron Giles 2012-02-19 02:01:54 +00:00
parent 1db230096b
commit a33c799e22
2 changed files with 6 additions and 2 deletions

View File

@ -191,6 +191,10 @@ void *malloc_array_file_line(size_t size, const char *file, int line)
void free_file_line(void *memory, const char *file, int line)
{
// ignore NULL frees/deletes
if (memory == NULL)
return;
// find the memory entry
memory_entry *entry = memory_entry::find(memory);

View File

@ -76,7 +76,7 @@ public:
// helpers
void append(const _ElementType &element) { if (m_count == m_allocated) expand_internal((m_allocated == 0) ? 16 : (m_allocated << 1), true); m_array[m_count++] = element; }
void reset() { if (m_array) delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
void reset() { delete[] m_array; m_array = NULL; m_count = m_allocated = 0; }
void resize(int count, bool keepdata = false) { if (count > m_allocated) expand_internal(count, keepdata); m_count = count; }
private:
@ -89,7 +89,7 @@ private:
if (keepdata)
for (int index = 0; index < m_count; index++)
newarray[index] = m_array[index];
if (m_array) delete[] m_array;
delete[] m_array;
m_array = newarray;
}