From 3b5cd286f6ee51b50baf136040f4033ad589ad81 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 1 Dec 2014 14:09:22 +1100 Subject: [PATCH] Do not destroy overlay if it was never created (e.g. due to an Ogre exception). --- apps/opencs/view/render/pagedworldspacewidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index bae0fcacf4..e7954491f2 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -362,8 +362,11 @@ CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget() delete iter->second; } - removeRenderTargetListener(mOverlayMask); - delete mOverlayMask; + if(mOverlayMask) + { + removeRenderTargetListener(mOverlayMask); + delete mOverlayMask; + } } void CSVRender::PagedWorldspaceWidget::useViewHint (const std::string& hint)