From: ageay Date: Fri, 8 Feb 2013 17:28:10 +0000 (+0000) Subject: clean up X-Git-Tag: V6_main_FINAL~365 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=682b50fe5c29652f37a459511998f78865fa676d;p=tools%2Fmedcoupling.git clean up --- 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(); } /*!