Salome HOME
22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs
authoreap <eap@opencascade.com>
Wed, 24 Jul 2013 14:49:27 +0000 (14:49 +0000)
committereap <eap@opencascade.com>
Wed, 24 Jul 2013 14:49:27 +0000 (14:49 +0000)
Pb: myLimit leaks if it was not provided at construction

src/SMESHUtils/SMESH_Tree.hxx

index 8f6d66f1af3268d192f6e297204ff21d7e88b454..61ee057f0975f7c7f9dbde090cc1551330691b51 100644 (file)
@@ -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<BND_BOX,NB_CHILDREN>::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<BND_BOX,NB_CHILDREN>::compute()
 {
   if ( myLevel==0 )
   {
+    if ( !myLimit ) myLimit = new SMESH_TreeLimit();
     myBox = buildRootBox();
     if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize )
       myIsLeaf = true;