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:
@@ -153,6 +153,16 @@ wxStatusBar::~wxStatusBar()
|
|||||||
// occupy
|
// occupy
|
||||||
PostSizeEventToParent();
|
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);
|
wxDELETE(m_pDC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,8 +189,11 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths)
|
|||||||
// reset all current tooltips
|
// reset all current tooltips
|
||||||
for (size_t i=0; i<m_tooltips.size(); i++)
|
for (size_t i=0; i<m_tooltips.size(); i++)
|
||||||
{
|
{
|
||||||
delete m_tooltips[i];
|
if (m_tooltips[i])
|
||||||
m_tooltips[i] = NULL;
|
{
|
||||||
|
delete m_tooltips[i];
|
||||||
|
m_tooltips[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// shrink/expand the array:
|
// shrink/expand the array:
|
||||||
|
Reference in New Issue
Block a user