зеркало из https://github.com/mozilla/pjs.git
NOT PART OF BUILD. Fix for memory leak in simple array
This commit is contained in:
Родитель
2beda7afcc
Коммит
de5bbacac2
|
@ -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; }
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче