diff --git a/interface/wx/docview.h b/interface/wx/docview.h index b4670d759d..ed74d5d320 100644 --- a/interface/wx/docview.h +++ b/interface/wx/docview.h @@ -1530,8 +1530,12 @@ public: virtual bool OnSaveModified(); /** - Removes the view from the document's list of views, and calls - OnChangedViewList(). + Removes the view from the document's list of views. + + If the view was really removed, also calls OnChangedViewList(). + + @return @true if the view was removed or @false if the document didn't + have this view in the first place. */ virtual bool RemoveView(wxView* view); diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 176c53444c..5be66f1190 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -570,7 +570,9 @@ bool wxDocument::AddView(wxView *view) bool wxDocument::RemoveView(wxView *view) { - (void)m_documentViews.DeleteObject(view); + if ( !m_documentViews.DeleteObject(view) ) + return false; + OnChangedViewList(); return true; }