From 45fcac308a927f173b4cf7a5c705776be26c687f Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 18 Aug 2015 14:13:13 +0300 Subject: [PATCH] Issue #800 Crash on call of pop-up menu of Part result --- src/XGUI/XGUI_Displayer.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.39.2