]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #800 Crash on call of pop-up menu of Part result
authornds <natalia.donis@opencascade.com>
Tue, 18 Aug 2015 11:13:13 +0000 (14:13 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 18 Aug 2015 11:13:13 +0000 (14:13 +0300)
src/XGUI/XGUI_Displayer.cpp

index 78ecbc64119373a88158b81e7b71bf468969b2de..f09ee4528ae6b0b47aff5296cef9fa4f902ef800 100644 (file)
@@ -170,6 +170,8 @@ bool canBeShaded(Handle(AIS_InteractiveObject) theAIS)
   Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(theAIS);
   if (!aShapePrs.IsNull()) {
     TopoDS_Shape aShape = aShapePrs->Shape();
+    if (aShape.IsNull())
+      return false;
     TopAbs_ShapeEnum aType = aShape.ShapeType();
     if ((aType == TopAbs_VERTEX) || (aType == TopAbs_EDGE) || (aType == TopAbs_WIRE))
       return false;
@@ -227,6 +229,13 @@ void XGUI_Displayer::erase(ObjectPtr theObject, const bool theUpdateViewer)
     }
   }
   myResult2AISObjectMap.remove(theObject);
+
+#ifdef DEBUG_DISPLAY
+  std::ostringstream aPtrStr;
+  aPtrStr << theObject.get();
+  qDebug(QString("erase object: %1").arg(aPtrStr.str().c_str()).toStdString().c_str());
+  qDebug(getResult2AISObjectMapInfo().c_str());
+#endif
 }
 
 void XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer)
@@ -489,6 +498,10 @@ void XGUI_Displayer::eraseAll(const bool theUpdateViewer)
       updateViewer();
   }
   myResult2AISObjectMap.clear();
+#ifdef DEBUG_DISPLAY
+  qDebug("eraseAll");
+  qDebug(getResult2AISObjectMapInfo().c_str());
+#endif
 }
 
 void XGUI_Displayer::deactivateTrihedron() const