From bad0d8d297af3372697c958d3cab426d85f3e16d Mon Sep 17 00:00:00 2001 From: sbh Date: Mon, 10 Oct 2011 13:00:06 +0000 Subject: [PATCH] Safeguarding ViewManager of crashing with "null-pointer" exceptions. --- src/SUIT/SUIT_ViewManager.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 00dd41235..4249fa872 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -338,8 +338,10 @@ void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view) */ void SUIT_ViewManager::closeAllViews() { - for ( int i = 0; i < myViews.size(); i++ ) - delete myViews[i]; + for ( int i = 0; i < myViews.size(); i++ ){ + if( !myViews[i].isNull() ) + delete myViews[i]; + } myViews.clear(); } -- 2.39.2