]> git.saurik.com Git - wxWidgets.git/commitdiff
Always call wxView::Close() when closing it.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Mar 2010 10:36:36 +0000 (10:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Mar 2010 10:36:36 +0000 (10:36 +0000)
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

index 6e1ef4c162a87ba5abb2062a4ec9ba1c0fcf1cd3..102653afa13848a78d7852fe90a9ead13b65fdb3 100644 (file)
@@ -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;