From: ageay Date: Wed, 26 Jun 2013 05:30:57 +0000 (+0000) Subject: Memory leaks hunting X-Git-Tag: B4CMakeModifs~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8f1b10c768c69876816025e943834c7a80090616;p=modules%2Fmed.git Memory leaks hunting --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 3d923508d..d3354f7fa 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -1805,6 +1805,7 @@ bool DataArrayDouble::areIncludedInMe(const DataArrayDouble *other, double prec, MEDCouplingAutoRefCountObjectPtr a=DataArrayDouble::Aggregate(this,other); DataArrayInt *c=0,*ci=0; a->findCommonTuples(prec,getNumberOfTuples(),c,ci); + MEDCouplingAutoRefCountObjectPtr cSafe(c),ciSafe(ci); int newNbOfTuples=-1; MEDCouplingAutoRefCountObjectPtr ids=DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(a->getNumberOfTuples(),c->begin(),ci->begin(),ci->end(),newNbOfTuples); MEDCouplingAutoRefCountObjectPtr ret1=ids->selectByTupleId2(getNumberOfTuples(),a->getNumberOfTuples(),1); diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index ee807d027..dfcc4a802 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -1278,7 +1278,8 @@ void MEDLoader::WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUM throw INTERP_KERNEL::Exception("MEDLoader::WriteUMesh : input mesh is null !"); int mod=writeFromScratch?2:0; MEDCouplingAutoRefCountObjectPtr m=MEDFileUMesh::New(); - m->setMeshAtLevel(0,static_cast(mesh->deepCpy()),true); + MEDCouplingAutoRefCountObjectPtr mcpy(static_cast(mesh->deepCpy())); + m->setMeshAtLevel(0,mcpy,true); m->write(fileName,mod); }