ruby: Fixed Directory memory destructor

This commit is contained in:
Brad Beckmann
2009-11-18 13:55:58 -08:00
parent b8c413e993
commit 204d1776ca

View File

@@ -84,11 +84,14 @@ void DirectoryMemory::init(const vector<string> & argv)
DirectoryMemory::~DirectoryMemory()
{
// free up all the directory entries
for (int i=0;i<m_num_entries;i++)
if (m_entries[i] != NULL)
delete m_entries;
if (m_entries != NULL)
for (uint64 i=0;i<m_num_entries;i++) {
if (m_entries[i] != NULL) {
delete m_entries[i];
}
}
if (m_entries != NULL) {
delete [] m_entries;
}
}
void DirectoryMemory::printConfig(ostream& out) const