handle child destruction notifications in wxTLW itself and reset both normal and temporary default item pointers when the default window is destroyed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -318,23 +318,9 @@ wxWindowBase::~wxWindowBase()
|
||||
|
||||
wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
|
||||
|
||||
// reset the top-level parent's default item if it is this widget
|
||||
// notify the parent about this window destruction
|
||||
if ( m_parent )
|
||||
{
|
||||
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent((wxWindow*)this),
|
||||
wxTopLevelWindow);
|
||||
|
||||
if ( tlw && tlw->GetDefaultItem() == this )
|
||||
tlw->SetDefaultItem(NULL);
|
||||
if ( tlw && tlw->GetTmpDefaultItem() == this )
|
||||
tlw->SetTmpDefaultItem(NULL);
|
||||
}
|
||||
|
||||
// reset the dangling pointer our parent window may keep to us
|
||||
if ( m_parent )
|
||||
{
|
||||
m_parent->RemoveChild(this);
|
||||
}
|
||||
|
||||
#if wxUSE_CARET
|
||||
delete m_caret;
|
||||
|
Reference in New Issue
Block a user