]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/window.cpp
make sure we don't keep a focus pointer to a window that gets deleted
[wxWidgets.git] / src / mac / window.cpp
index 8e269242e89932df36c58145b6bf1062858fd84e..bc83a282a225fd13a57852e4868ffaa9e3e9122b 100644 (file)
@@ -169,6 +169,13 @@ wxWindowMac::~wxWindowMac()
     {
         s_lastMouseWindow = NULL ;
     }
+    
+    wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ;
+    if ( frame )
+    {
+       if ( frame->GetLastFocus() == this )
+               frame->SetLastFocus( NULL ) ;
+    }
 
     if ( gFocusWindow == this )
     {