From: Vadim Zeitlin Date: Fri, 23 Jul 2010 23:33:32 +0000 (+0000) Subject: Just call wxDocManager::CloseDocument() instead of duplicating it. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/568b12fab06f1cde9d37f5ce633ffc505116761f Just call wxDocManager::CloseDocument() instead of duplicating it. No real changes but avoid making the document deletion code even more opaque by duplicating the code already existing as a function elsewhere. Closes #11364. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 6544987b1b..2111cfd22f 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1036,14 +1036,8 @@ wxFileHistory *wxDocManager::OnCreateFileHistory() void wxDocManager::OnFileClose(wxCommandEvent& WXUNUSED(event)) { wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - if (doc->Close()) - { - doc->DeleteAllViews(); - if (m_docs.Member(doc)) - delete doc; - } + if (doc) + CloseDocument(doc); } void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event))