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

git-svn-id: svn://10.0.0.236/trunk@106730 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2001-10-30 23:06:50 +00:00
parent 73ff098797
commit ca8a7aea9f
2 changed files with 11 additions and 4 deletions

View File

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

View File

@@ -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; }
};