avoid leaking allocated tooltips

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi 2009-05-28 20:31:38 +00:00
parent bba60a82b9
commit 421962befc

View File

@ -153,6 +153,16 @@ wxStatusBar::~wxStatusBar()
// occupy
PostSizeEventToParent();
// delete existing tooltips
for (size_t i=0; i<m_tooltips.size(); i++)
{
if (m_tooltips[i])
{
delete m_tooltips[i];
m_tooltips[i] = NULL;
}
}
wxDELETE(m_pDC);
}
@ -179,8 +189,11 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths)
// reset all current tooltips
for (size_t i=0; i<m_tooltips.size(); i++)
{
delete m_tooltips[i];
m_tooltips[i] = NULL;
if (m_tooltips[i])
{
delete m_tooltips[i];
m_tooltips[i] = NULL;
}
}
// shrink/expand the array: