don't delete the exiting tooltip if SetToolTip() is called with the same one

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-12 20:17:40 +00:00
parent c0f482800a
commit 0cb5718761

View File

@@ -1527,10 +1527,13 @@ void wxWindowBase::SetToolTip( const wxString &tip )
void wxWindowBase::DoSetToolTip(wxToolTip *tooltip) void wxWindowBase::DoSetToolTip(wxToolTip *tooltip)
{ {
if ( m_tooltip ) if ( m_tooltip != tooltip )
delete m_tooltip; {
if ( m_tooltip )
delete m_tooltip;
m_tooltip = tooltip; m_tooltip = tooltip;
}
} }
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS