From: eap Date: Fri, 14 Dec 2012 13:13:00 +0000 (+0000) Subject: 21948: EDF SMESH : Memory is not freed when deleting a mesh X-Git-Tag: pluginMGCleaner~267 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=56b857de474b04e64c07af363f188330062c5ca1;p=modules%2Fsmesh.git 21948: EDF SMESH : Memory is not freed when deleting a mesh fix leaks of cellLinks: adjuct vtkCellLinks::MaxId + void ResizeForPoint(vtkIdType vtkID); --- diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 1eb5c445d..5a0578996 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -17,7 +17,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#define CHRONODEF #include "SMDS_UnstructuredGrid.hxx" #include "SMDS_Mesh.hxx" #include "SMDS_MeshInfo.hxx" @@ -44,14 +43,14 @@ SMDS_CellLinks* SMDS_CellLinks::New() return new SMDS_CellLinks(); } -vtkCellLinks::Link* SMDS_CellLinks::ResizeL(vtkIdType sz) +void SMDS_CellLinks::ResizeForPoint(vtkIdType vtkID) { - return vtkCellLinks::Resize(sz); -} - -vtkIdType SMDS_CellLinks::GetLinksSize() -{ - return this->Size; + if ( vtkID > this->MaxId ) + { + this->MaxId = vtkID; + if ( vtkID >= this->Size ) + vtkCellLinks::Resize( vtkID+SMDS_Mesh::chunkSize ); + } } SMDS_CellLinks::SMDS_CellLinks() : @@ -154,7 +153,7 @@ void SMDS_UnstructuredGrid::setSMDS_mesh(SMDS_Mesh *mesh) void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int newNodeSize, std::vector& idCellsOldToNew, int newCellSize) { - MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);CHRONO(1); + MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1); int alreadyCopied = 0; // --- if newNodeSize, create a new compacted vtkPoints