]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
added new text event macros description
[wxWidgets.git] / src / common / wincmn.cpp
index 4c5ebcc5da795b8db66265e7cf235bec621d371a..f71daad3b5433762a9c07c10b78491021ecc47be 100644 (file)
@@ -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()