NOT PART OF BUILD. Fix for memory leak in simple array

This commit is contained in:
locka%iol.ie 2001-10-30 23:06:50 +00:00
Родитель 2beda7afcc
Коммит de5bbacac2
2 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -413,6 +413,7 @@ HRESULT nsPluginHostCtrl::CleanupPluginList()
free(pI->szPluginPath);
free(pI);
}
m_Plugins.Empty();
return S_OK;
}

Просмотреть файл

@ -63,10 +63,7 @@ public:
virtual ~nsSimpleArray()
{
if (m_pData)
{
free(m_pData);
}
Empty();
}
Entry ElementAt(unsigned long aIndex) const
@ -132,6 +129,15 @@ public:
}
}
void Empty()
{
if (m_pData)
{
free(m_pData);
m_pData = NULL;
m_nSize = m_nMaxSize = 0;
}
}
BOOL IsEmpty() const { return m_nSize == 0 ? TRUE : FALSE; }
unsigned long Count() const { return m_nSize; }
};