]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Memory leak kill
authorageay <ageay>
Wed, 10 Apr 2013 13:51:16 +0000 (13:51 +0000)
committerageay <ageay>
Wed, 10 Apr 2013 13:51:16 +0000 (13:51 +0000)
src/MEDCoupling/MEDCouplingFieldDouble.cxx

index 8eefe13dfef7c296dab186e873ef9e97d205147f..5d6b783f955a4f0098b6e64f28ff9aed81168a72 100644 (file)
@@ -545,7 +545,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg,
   DataArrayInt *arrSelect;
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=_type->buildSubMeshData(_mesh,partBg,partEnd,arrSelect);
   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> arrSelect2(arrSelect);
-  MEDCouplingFieldDouble *ret=clone(false);//quick shallow copy.
+  MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=clone(false);//quick shallow copy.
   const MEDCouplingFieldDiscretization *disc=getDiscretization();
   if(disc)
     ret->setDiscretization(MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDiscretization>(disc->clonePart(partBg,partEnd)));
@@ -566,7 +566,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildSubPart(const int *partBg,
   for(std::vector<DataArrayDouble *>::const_iterator iter=arrs.begin();iter!=arrs.end();iter++)
     if(*iter)
       (*iter)->decrRef();
-  return ret;
+  return ret.retn();
 }
 
 TypeOfTimeDiscretization MEDCouplingFieldDouble::getTimeDiscretization() const