Salome HOME
Copyright update 2021
[modules/smesh.git] / src / SMDS / SMDS_ElementFactory.cxx
index 48d25afb5abfab665e54f53b71377ac9d64e92e0..e6518d7f241952f5c2bf2c7fb2ba357da708b348 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -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;