From 1fe6cd3e9f77aee96ea5698bb1af74dc00604040 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 7 Oct 2010 14:28:55 +0000 Subject: [PATCH] Fix bug connected with removing of the mesh after closing last viewer window. --- src/SMESHGUI/SMESHGUI.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index a81fdaec4..1efc41fd2 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1164,7 +1164,7 @@ SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); SUIT_ViewManager* vm = anApp->activeViewManager(); - int nbSf = vm->getViewsCount(); + int nbSf = vm ? vm->getViewsCount() : 0; SALOME_ListIteratorOfListIO It(selected); @@ -1206,7 +1206,7 @@ std::string anEntry = SO->GetID(); /** Erase graphical object **/ - if(SO->FindAttribute(anAttr, "AttributeIOR")){ + if(SO->FindAttribute(anAttr, "AttributeIOR") && vm ){ QVector aViews = vm->getViews(); for(int i = 0; i < nbSf; i++){ SUIT_ViewWindow *sf = aViews[i];