From: ageay Date: Fri, 17 Feb 2012 07:53:49 +0000 (+0000) Subject: Bug correction : memory leak. X-Git-Tag: V6_main_FINAL~848 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00864d32c0a423ac95eec8722d9fa41a1f44d80c;p=tools%2Fmedcoupling.git Bug correction : memory leak. --- diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index bc19d8f8a..52d8bde4a 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -1301,7 +1301,6 @@ DataArrayDouble *MEDFileUMesh::getCoords() const MEDCouplingAutoRefCountObjectPtr tmp(_coords); if((DataArrayDouble *)tmp) { - tmp->incrRef(); return tmp; } return 0; diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index c9d9894ce..d27f2ab59 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -469,7 +469,6 @@ namespace ParaMEDMEM std::vector getFamsNonEmptyLevels(const std::vector& fams) const throw(INTERP_KERNEL::Exception); std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const throw(INTERP_KERNEL::Exception); std::vector getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); - DataArrayDouble *getCoords() const; MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception); DataArrayInt *getGroupArr(int meshDimRelToMaxExt, const char *grp, bool renum=false) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector& grps, bool renum=false) const throw(INTERP_KERNEL::Exception); @@ -515,6 +514,14 @@ namespace ParaMEDMEM convertPyObjToVecDataArrayIntCst(li,grps); self->setGroupsAtLevel(meshDimRelToMaxExt,grps,renum); } + + DataArrayDouble *getCoords() const + { + DataArrayDouble *ret=self->getCoords(); + if(ret) + ret->incrRef(); + return ret; + } } };