X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f763782968b314d45c416e2066b9ae5cc56aa406..f2616db56739e4962f683f59ac9e207756efe23c:/src/common/wincmn.cpp?ds=sidebyside diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 4c5ebcc5da..f71daad3b5 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -268,6 +268,12 @@ wxWindowBase::~wxWindowBase() if ( m_tooltip ) delete m_tooltip; #endif // wxUSE_TOOLTIPS + + // reset the dangling pointer our parent window may keep to us + if ( m_parent && m_parent->GetDefaultItem() == this ) + { + m_parent->SetDefaultItem(NULL); + } } bool wxWindowBase::Destroy()