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:
parent
bba60a82b9
commit
421962befc
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user