From fd76aa8d8ae3d8b702b7155ce15c1a927257f1fc Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 23 Aug 2002 13:31:14 +0000 Subject: [PATCH] make sure we don't keep a focus pointer to a window that gets deleted git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 7 +++++++ src/mac/window.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 8e269242e8..bc83a282a2 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -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 ) { diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 8e269242e8..bc83a282a2 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -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 ) { -- 2.45.2