From 66c4d2b4164c71eaf5ec07d5f20157a2570c2885 Mon Sep 17 00:00:00 2001 From: ageay Date: Wed, 10 Apr 2013 13:51:16 +0000 Subject: [PATCH] Memory leak kill --- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index 8eefe13df..5d6b783f9 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -545,7 +545,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg, DataArrayInt *arrSelect; MEDCouplingAutoRefCountObjectPtr m=_type->buildSubMeshData(_mesh,partBg,partEnd,arrSelect); MEDCouplingAutoRefCountObjectPtr arrSelect2(arrSelect); - MEDCouplingFieldDouble *ret=clone(false);//quick shallow copy. + MEDCouplingAutoRefCountObjectPtr ret=clone(false);//quick shallow copy. const MEDCouplingFieldDiscretization *disc=getDiscretization(); if(disc) ret->setDiscretization(MEDCouplingAutoRefCountObjectPtr(disc->clonePart(partBg,partEnd))); @@ -566,7 +566,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg, for(std::vector::const_iterator iter=arrs.begin();iter!=arrs.end();iter++) if(*iter) (*iter)->decrRef(); - return ret; + return ret.retn(); } TypeOfTimeDiscretization MEDCouplingFieldDouble::getTimeDiscretization() const -- 2.39.2