Salome HOME
Fix CRASH after mesh.RemoveGroupWithContents( group_of_other_mesh )
[modules/smesh.git] / src / SMDS / SMDS_ElementFactory.cxx
index 41018a0d9714e056992ab0b85ea631a936db3849..12b0f80b00ef3d049fb6012d9a2c52a60b7edab2 100644 (file)
@@ -239,6 +239,9 @@ int SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID )
 
 void SMDS_ElementFactory::Free( const SMDS_MeshElement* e )
 {
+  if ( e != FindElement( e->GetID() ))
+    SALOME_Exception("SMDS_ElementFactory::Free(): element of other mesh");
+
   if ( !myVtkIDs.empty() )
   {
     size_t    id = e->GetID() - 1;