From: Václav Slavík Date: Wed, 23 May 2001 17:02:18 +0000 (+0000) Subject: fixed bug in wxFrame::OnActivate X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/de243b058f059e1264c2d53346eab6190b3a11c2 fixed bug in wxFrame::OnActivate (added virtual void RemoveChild() which make sure OnActivate won't accidentally use invalid m_winLastFocused ptr) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 5e161cd3ab..91c11c01c1 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -61,6 +61,8 @@ public: // override some more virtuals virtual bool Show(bool show = TRUE); + virtual void RemoveChild( wxWindowBase *child ); + // event handlers void OnActivate(wxActivateEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 9a699cfebc..7f82254fad 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -799,6 +799,13 @@ void wxFrame::OnActivate(wxActivateEvent& event) } } +void wxFrame::RemoveChild( wxWindowBase *child ) +{ + if ( child == m_winLastFocused ) + m_winLastFocused = NULL; + wxFrameBase::RemoveChild(child); +} + // ---------------------------------------------------------------------------- // tool/status bar stuff // ----------------------------------------------------------------------------