From cf30eac295e012ad76104bc49fcfaa639a536b8b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Mar 2010 10:36:36 +0000 Subject: [PATCH] Always call wxView::Close() when closing it. After wxDocView refactoring the behaviour has changed and wxView::Close() and hence user-overriddable OnClose() called from it) was only called if the close event could be vetoed. This broke code which relied on OnClose() being executed in any case to perform some cleanup and was incompatible with 2.8 so restore the old behaviour now. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 6e1ef4c162..102653afa1 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1844,7 +1844,9 @@ bool wxDocChildFrameAnyBase::CloseView(wxCloseEvent& event) { if ( m_childView ) { - if ( event.CanVeto() && !m_childView->Close(false) ) + // notice that we must call wxView::Close() and OnClose() called from + // it in any case, even if we know that we are going to close anyhow + if ( !m_childView->Close(false) && event.CanVeto() ) { event.Veto(); return false; -- 2.49.0