]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure we don't keep a focus pointer to a window that gets deleted
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 23 Aug 2002 13:31:14 +0000 (13:31 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 23 Aug 2002 13:31:14 +0000 (13:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp
src/mac/window.cpp

index 8e269242e89932df36c58145b6bf1062858fd84e..bc83a282a225fd13a57852e4868ffaa9e3e9122b 100644 (file)
@@ -169,6 +169,13 @@ wxWindowMac::~wxWindowMac()
     {
         s_lastMouseWindow = NULL ;
     }
     {
         s_lastMouseWindow = NULL ;
     }
+    
+    wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ;
+    if ( frame )
+    {
+       if ( frame->GetLastFocus() == this )
+               frame->SetLastFocus( NULL ) ;
+    }
 
     if ( gFocusWindow == this )
     {
 
     if ( gFocusWindow == this )
     {
index 8e269242e89932df36c58145b6bf1062858fd84e..bc83a282a225fd13a57852e4868ffaa9e3e9122b 100644 (file)
@@ -169,6 +169,13 @@ wxWindowMac::~wxWindowMac()
     {
         s_lastMouseWindow = NULL ;
     }
     {
         s_lastMouseWindow = NULL ;
     }
+    
+    wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ;
+    if ( frame )
+    {
+       if ( frame->GetLastFocus() == this )
+               frame->SetLastFocus( NULL ) ;
+    }
 
     if ( gFocusWindow == this )
     {
 
     if ( gFocusWindow == this )
     {