]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
just to resolve a dummy conflict
[wxWidgets.git] / src / common / wincmn.cpp
index 87709ad66a4b3dcc167a3a3f55fcca2783800481..2665e8d0ec4db857086d5373590a1eda156759ad 100644 (file)
@@ -191,6 +191,16 @@ wxWindowBase::~wxWindowBase()
 
     wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") );
 
 
     wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") );
 
+    // make sure that there are no dangling pointers left pointing to us
+    wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
+    if ( panel )
+    {
+        if ( panel->GetLastFocus() == this )
+        {
+            panel->SetLastFocus((wxWindow *)NULL);
+        }
+    }
+
 #if wxUSE_CARET
     if ( m_caret )
         delete m_caret;
 #if wxUSE_CARET
     if ( m_caret )
         delete m_caret;