From c16b56edc1cf0d550d5b65ce74498e51766accbf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 7 Dec 2009 15:06:10 +0000 Subject: [PATCH] Safer access of member variables git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index ffb5419ca2..8ff5adf858 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -630,8 +630,10 @@ wxView::wxView() wxView::~wxView() { - GetDocumentManager()->ActivateView(this, false); - m_viewDocument->RemoveView(this); + if (GetDocumentManager()) + GetDocumentManager()->ActivateView(this, false); + if (m_viewDocument) + m_viewDocument->RemoveView(this); } // Extend event processing to search the document's event table