From: rnv Date: Mon, 27 Apr 2015 11:52:23 +0000 (+0300) Subject: Fix for the '52701: SIGSEGV in Mesh creation dialog box after activating Viscous... X-Git-Tag: V7_6_0rc1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=299e2326cd42edd35b87946a5a801899f821d875 Fix for the '52701: SIGSEGV in Mesh creation dialog box after activating Viscous Layers hypothesis' issue. --- diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index c98495e8b..13ad359cd 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -551,9 +551,17 @@ void SMESHGUI_MeshOp::selectionDone() for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { QString aSubGeomEntry = (*aSubShapesIter); _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data()); - GEOM::GEOM_Object_var aSubGeomVar = - GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject()); - aSeq[iSubSh] = aSubGeomVar; + + if( pSubGeom ) { + SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom); + if( sobj ) { + GEOM::GEOM_Object_var aSubGeomVar = + GEOM::GEOM_Object::_narrow(sobj->GetObject()); + if( !aSubGeomVar->_is_nil() ){ + aSeq[iSubSh] = aSubGeomVar; + } + } + } } } else { // get geometry by selected sub-mesh diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx index af60f62de..7b605972d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx @@ -134,6 +134,8 @@ StdMeshersGUI_SubShapeSelectorWdg::~StdMeshersGUI_SubShapeSelectorWdg() mySelectionMgr->removeFilter( myFilter ); delete myFilter; myFilter=0; + mySelectionMgr->clearSelected(); + SUIT_SelectionFilter* filter; foreach( filter, myGeomFilters ) delete filter;