]> SALOME platform Git repositories - tools/medcoupling.git/blobdiff - src/ParaMEDMEM/ParaMESH.cxx
Salome HOME
refactor!: remove adm_local/ directory
[tools/medcoupling.git] / src / ParaMEDMEM / ParaMESH.cxx
index d4c1045f4587caf5e6261e041d24f0533366dd90..92965d4c2f116f6706031d0d228434a4a03a4919 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -76,9 +76,19 @@ namespace MEDCoupling
   }
 
   ParaMESH::~ParaMESH()
+  {
+    release();
+  }
+
+  /** Destructor involves MPI operations: make sure this is accessible from a proper
+   * method for Python wrapping.
+   */
+  void ParaMESH::release()
   {
     delete _block_topology;
     delete _explicit_topology;
+    _block_topology = nullptr;
+    _explicit_topology = nullptr;
   }
 
 }