From: abn Date: Thu, 22 Oct 2015 13:22:02 +0000 (+0200) Subject: Mem leak fix in OverlapDEC. X-Git-Tag: V8_0_pre~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=637b7afb02f078b24f2c2ac86f96a5191c6cf6ea;p=modules%2Fmed.git Mem leak fix in OverlapDEC. --- diff --git a/src/ParaMEDMEM/OverlapDEC.cxx b/src/ParaMEDMEM/OverlapDEC.cxx index c799c23aa..0c02028d7 100644 --- a/src/ParaMEDMEM/OverlapDEC.cxx +++ b/src/ParaMEDMEM/OverlapDEC.cxx @@ -203,9 +203,11 @@ namespace ParaMEDMEM The method in charge to perform this is : ParaMEDMEM::OverlapMapping::prepare. */ - OverlapDEC::OverlapDEC(const std::set& procIds, const MPI_Comm& world_comm):_own_group(true),_interpolation_matrix(0), - _source_field(0),_own_source_field(false), - _target_field(0),_own_target_field(false) + OverlapDEC::OverlapDEC(const std::set& procIds, const MPI_Comm& world_comm): + _own_group(true),_interpolation_matrix(0), + _source_field(0),_own_source_field(false), + _target_field(0),_own_target_field(false), + _comm(MPI_COMM_NULL) { ParaMEDMEM::CommInterface comm; int *ranks_world=new int[procIds.size()]; // ranks of sources and targets in world_comm @@ -214,10 +216,10 @@ namespace ParaMEDMEM comm.commGroup(world_comm,&world_group); comm.groupIncl(world_group,procIds.size(),ranks_world,&group); delete [] ranks_world; - MPI_Comm theComm; - comm.commCreate(world_comm,group,&theComm); + comm.commCreate(world_comm,group,&_comm); comm.groupFree(&group); - if(theComm==MPI_COMM_NULL) + comm.groupFree(&world_group); + if(_comm==MPI_COMM_NULL) { _group=0; return ; @@ -225,7 +227,7 @@ namespace ParaMEDMEM std::set idsUnion; for(std::size_t i=0;i