From: vsr Date: Mon, 15 Jun 2020 15:44:50 +0000 (+0300) Subject: bos #19219 [CEA] SIGSEGV when right-click in the view in 3D layers dialog box X-Git-Tag: V9_5_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c4fc1442c1cd2777735f23303685ee6831ce819;p=modules%2Fsmesh.git bos #19219 [CEA] SIGSEGV when right-click in the view in 3D layers dialog box --- diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 6f59abd8c..5abe5c5be 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -43,8 +43,6 @@ #include #include #include -#include -#include // IDL includes #include @@ -79,8 +77,6 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr if( mgr ) { - myOwners.clear(); - mgr->selected(myOwners, client); for( int i=0, n=count(); i= 0 && ind < myTypes.count()) { - if (isReference(ind)) { - SUIT_DataOwner* aOwn = myOwners.at(ind); - LightApp_DataOwner* sowner = dynamic_cast(aOwn); - QString aEntry = sowner->entry(); - _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID(aEntry.toStdString()); - _PTR(SObject) aFatherObj = aSObject->GetFather(); - _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); - if (aComponent->ComponentDataType() == "SMESH") { - QString aObjEntry = entry(ind); - _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); - GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface(aGeomSObject); - if (!aObject->_is_nil()) - return aObject->IsParametrical(); + if ( ind >= 0 && isReference(ind) ) { + QString aEntry = objectInfo(ind, OI_RefEntry).toString(); + if (!aEntry.isEmpty()) { + _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( aEntry.toStdString()); + if (aSObject) { + _PTR(SObject) aFatherObj = aSObject->GetFather(); + if (aFatherObj) { + _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); + if (aComponent && aComponent->ComponentDataType() == "SMESH") { + QString aObjEntry = entry(ind); + _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); + GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface(aGeomSObject); + if (!aObject->_is_nil()) + return aObject->IsParametrical(); + } + } } } } diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index 5d23e768f..e4b0641e0 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -32,7 +32,6 @@ // SALOME GUI includes #include -#include // SALOME KERNEL includes #include @@ -97,7 +96,6 @@ private: QStringList myTypes; QStringList myControls; QList myActors; - SUIT_DataOwnerPtrList myOwners; }; #endif // SMESHGUI_SELECTION_H