Salome HOME
Issue #2349 Fatal error when close window Hide faces
authornds <nds@opencascade.com>
Thu, 7 Dec 2017 10:18:52 +0000 (13:18 +0300)
committernds <nds@opencascade.com>
Thu, 7 Dec 2017 10:18:52 +0000 (13:18 +0300)
src/XGUI/XGUI_FacesPanel.cpp

index 565f611f5d55505b3ca7925698eec16285a0ea3c..0c9124ff9c7c7bd1812684c9c398a4e57f175412 100644 (file)
@@ -74,13 +74,17 @@ XGUI_FacesPanel::XGUI_FacesPanel(QWidget* theParent, ModuleBase_IWorkshop* theWo
 //********************************************************************
 void XGUI_FacesPanel::reset(const bool isToFlushRedisplay)
 {
+  if (myLastItemIndex == 0) // do nothing because there was no activity in the pane after reset
+    return;
+
   // clear internal containers
   myListView->getControl()->clear();
   myItems.clear();
 
   // restore previous view of presentations
   bool isModified = redisplayObjects(myItemObjects, false);
-  isModified = displayHiddenObjects(myHiddenObjects, false) || isModified;
+  std::set<std::shared_ptr<ModelAPI_Object> > aHiddenObjects = myHiddenObjects;
+  isModified = displayHiddenObjects(aHiddenObjects, false) || isModified;
   if (isModified && isToFlushRedisplay)
     Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));