From: ageay Date: Mon, 4 Feb 2013 09:59:58 +0000 (+0000) Subject: Debug X-Git-Tag: V6_main_FINAL~396 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=671d04081a7119dd08fa1d53b3d80f834b413b48;p=tools%2Fmedcoupling.git Debug --- diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 630a2bed2..a11468811 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -110,12 +110,12 @@ void MEDCouplingCMesh::updateTime() const std::size_t MEDCouplingCMesh::getHeapMemorySize() const { std::size_t ret=0; - if(_x_array) - ret+=_x_array->getHeapMemorySize(); - if(_y_array) - ret+=_y_array->getHeapMemorySize(); - if(_z_array) - ret+=_z_array->getHeapMemorySize(); + std::set s; + s.insert(_x_array); s.insert(_y_array); s.insert(_z_array); + s.erase(NULL); + for(std::set::const_iterator it=s.begin();it!=s.end();it++) + if(*it) + ret+=(*it)->getHeapMemorySize(); return MEDCouplingMesh::getHeapMemorySize()+ret; }