From e11c322ee99865152a721cede00ceb9f70b1603d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 24 Jul 2013 14:49:27 +0000 Subject: [PATCH] 22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs Pb: myLimit leaks if it was not provided at construction --- src/SMESHUtils/SMESH_Tree.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.30.2