From 682b50fe5c29652f37a459511998f78865fa676d Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 8 Feb 2013 17:28:10 +0000 Subject: [PATCH] clean up --- src/MEDCoupling/MEDCouplingUMesh.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 42fb92fef..a34d71b80 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -6026,13 +6026,12 @@ MEDCouplingMesh *MEDCouplingUMesh::mergeMyselfWith(const MEDCouplingMesh *other) */ DataArrayDouble *MEDCouplingUMesh::getBarycenterAndOwner() const { - DataArrayDouble *ret=DataArrayDouble::New(); + MEDCouplingAutoRefCountObjectPtr ret=DataArrayDouble::New(); int spaceDim=getSpaceDimension(); int nbOfCells=getNumberOfCells(); ret->alloc(nbOfCells,spaceDim); ret->copyStringInfoFrom(*getCoords()); double *ptToFill=ret->getPointer(); - double *tmp=new double[spaceDim]; const int *nodal=_nodal_connec->getConstPointer(); const int *nodalI=_nodal_connec_index->getConstPointer(); const double *coor=_coords->getConstPointer(); @@ -6042,8 +6041,7 @@ DataArrayDouble *MEDCouplingUMesh::getBarycenterAndOwner() const INTERP_KERNEL::computeBarycenter2(type,nodal+nodalI[i]+1,nodalI[i+1]-nodalI[i]-1,coor,spaceDim,ptToFill); ptToFill+=spaceDim; } - delete [] tmp; - return ret; + return ret.retn(); } /*! -- 2.39.2