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
This commit is contained in:
parent
ab5259d977
commit
568b12fab0
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user