From f0bd165e4996309e9f659d2e409be3ab59a0d945 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 25 Sep 2009 08:35:12 +0000 Subject: [PATCH] Changed order of calls to avoid crash after deletion of window in kill focus event git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index b77f07a214..e4653d6219 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -362,8 +362,9 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl inKillFocusEvent = true ; wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + // Call this function before sending the event, in case the window is destroyed. thisWindow->wxWindowMac::OnSetFocus(event); + thisWindow->GetEventHandler()->ProcessEvent(event) ; inKillFocusEvent = false ; } }