From: eap Date: Thu, 14 Feb 2019 11:22:06 +0000 (+0300) Subject: #16578 EDF - Scibian - ViscousLayer / SIGSEGV X-Git-Tag: V9_3_0a1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=27c94e830e4177547d0ef692a491f16db4bd1617;p=modules%2Fsmesh.git #16578 EDF - Scibian - ViscousLayer / SIGSEGV --- diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 8b2d1c5d2..6585e104c 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -263,6 +263,10 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, const bool ignoreAuxiliary) const { SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + + std::list savedHyps; // don't delete the list if + savedHyps.swap( me->_usedHypList ); // it does not change (#16578) + me->_usedHypList.clear(); if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary )) { @@ -270,6 +274,9 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh, if ( ignoreAuxiliary && _usedHypList.size() > 1 ) me->_usedHypList.clear(); //only one compatible hypothesis allowed } + if ( _usedHypList == savedHyps ) + savedHyps.swap( me->_usedHypList ); + return _usedHypList; } @@ -287,10 +294,17 @@ SMESH_Algo::GetAppliedHypothesis(SMESH_Mesh & aMesh, const bool ignoreAuxiliary) const { SMESH_Algo* me = const_cast< SMESH_Algo* >( this ); + + std::list savedHyps; // don't delete the list if + savedHyps.swap( me->_appliedHypList ); // it does not change (#16578) + me->_appliedHypList.clear(); if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary )) aMesh.GetHypotheses( aShape, *filter, me->_appliedHypList, false ); + if ( _appliedHypList == savedHyps ) + savedHyps.swap( me->_appliedHypList ); + return _appliedHypList; } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 7ef847bf0..1c064e31b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -7394,16 +7394,16 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments, } else if ( theGroupName[0] ) // find/create a group of segments { - SMESH_Mesh::GroupIteratorPtr grpIt = myMesh->GetGroups(); - while ( !groupDS && grpIt->more() ) - { - SMESH_Group* group = grpIt->next(); - if ( group->GetGroupDS()->GetType() == SMDSAbs_Edge && - strcmp( group->GetName(), theGroupName ) == 0 ) - { - groupDS = dynamic_cast< SMESHDS_Group* >( group->GetGroupDS() ); - } - } + // SMESH_Mesh::GroupIteratorPtr grpIt = myMesh->GetGroups(); + // while ( !groupDS && grpIt->more() ) + // { + // SMESH_Group* group = grpIt->next(); + // if ( group->GetGroupDS()->GetType() == SMDSAbs_Edge && + // strcmp( group->GetName(), theGroupName ) == 0 ) + // { + // groupDS = dynamic_cast< SMESHDS_Group* >( group->GetGroupDS() ); + // } + // } if ( !groupDS ) { SMESH::SMESH_Group_var groupVar = myMesh_i->CreateGroup( SMESH::EDGE, theGroupName ); diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index a9264306c..32f658951 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -5356,7 +5356,7 @@ void SMESH_Mesh_i::CreateGroupServants() while ( groupIt->more() ) { ::SMESH_Group* group = groupIt->next(); - int anId = group->GetGroupDS()->GetID(); + int anId = group->GetID(); map::iterator it = _mapGroups.find(anId); if ( it != _mapGroups.end() && !CORBA::is_nil( it->second ))