From: eap Date: Wed, 24 Jul 2013 14:49:27 +0000 (+0000) Subject: 22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs X-Git-Tag: V7_3_0a1~249 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e11c322ee99865152a721cede00ceb9f70b1603d;p=modules%2Fsmesh.git 22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs Pb: myLimit leaks if it was not provided at construction --- diff --git a/src/SMESHUtils/SMESH_Tree.hxx b/src/SMESHUtils/SMESH_Tree.hxx index 8f6d66f1a..61ee057f0 100644 --- a/src/SMESHUtils/SMESH_Tree.hxx +++ b/src/SMESHUtils/SMESH_Tree.hxx @@ -85,7 +85,7 @@ class SMESH_Tree static int nbChildren() { return NB_CHILDREN; } - // Compute the bigger dimension of my box + // Compute the biggest dimension of my box virtual double maxSize() const = 0; protected: @@ -141,7 +141,7 @@ SMESH_Tree::SMESH_Tree (SMESH_TreeLimit* limit): myLevel(0), myBox(0) { - if ( !myLimit ) myLimit = new SMESH_TreeLimit(); + //if ( !myLimit ) myLimit = new SMESH_TreeLimit(); } //================================================================================ @@ -155,6 +155,7 @@ void SMESH_Tree::compute() { if ( myLevel==0 ) { + if ( !myLimit ) myLimit = new SMESH_TreeLimit(); myBox = buildRootBox(); if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize ) myIsLeaf = true;