X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb28b47763782647dcc1bec72786c16f39c48d35..217c78b80b34f31b4341d6257e28077255d6eb93:/src/common/docview.cpp diff --git a/src/common/docview.cpp b/src/common/docview.cpp index c368a8ee52..c0b5b82c9d 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -164,6 +164,8 @@ bool wxDocument::Close() bool wxDocument::OnCloseDocument() { + // Tell all views that we're about to close + NotifyClosing(); DeleteContents(); Modify(FALSE); return TRUE; @@ -508,6 +510,17 @@ void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint) } } +void wxDocument::NotifyClosing() +{ + wxNode *node = m_documentViews.First(); + while (node) + { + wxView *view = (wxView *)node->Data(); + view->OnClosingDocument(); + node = node->Next(); + } +} + void wxDocument::SetFilename(const wxString& filename, bool notifyViews) { m_documentFile = filename;