From 2913e597d9c2ce26383e6013443c510d68ce6435 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 16 Aug 2002 19:52:39 +0000 Subject: [PATCH] Don't send EVT_KILL_FOCUS when the window is in the process of being deleted. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ef3428dcee..b1b75973f6 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3298,6 +3298,13 @@ bool wxWindowMSW::HandleKillFocus(WXHWND hwnd) } #endif + // Don't send the event when in the process of being deleted. This can + // only cause problems if the event handler tries to access the object. + if ( m_isBeingDeleted ) + { + return FALSE; + } + wxFocusEvent event(wxEVT_KILL_FOCUS, m_windowId); event.SetEventObject(this); -- 2.45.2