From: nds Date: Tue, 18 Aug 2015 11:13:13 +0000 (+0300) Subject: Issue #800 Crash on call of pop-up menu of Part result X-Git-Tag: V_1.4.0_beta4~362 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=45fcac308a927f173b4cf7a5c705776be26c687f;p=modules%2Fshaper.git Issue #800 Crash on call of pop-up menu of Part result --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 78ecbc641..f09ee4528 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -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