Salome HOME
Fix memory leaks
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 7f96a76fdb0505717158b8b207d4f0c7e13f8058..67649a3265de416d0d4204e5d4e8cb1e41af6c11 100644 (file)
@@ -385,9 +385,9 @@ int SMESH_subMesh::computeCost() const
     int computeCost;
     switch ( _subShape.ShapeType() ) {
     case TopAbs_SOLID:
-    case TopAbs_SHELL: computeCost = 1000; break;
-    case TopAbs_FACE:  computeCost = 100; break;
-    case TopAbs_EDGE:  computeCost = 10; break;
+    case TopAbs_SHELL: computeCost = 5000; break;
+    case TopAbs_FACE:  computeCost = 500; break;
+    case TopAbs_EDGE:  computeCost = 2; break;
     default:           computeCost = 1;
     }
     SMESH_subMeshIteratorPtr childIt = getDependsOnIterator(/*includeSelf=*/false);
@@ -1561,6 +1561,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         }
         // Compute
 
+        // to restore cout that may be redirected by algo
+        std::streambuf* coutBuffer = std::cout.rdbuf();
+
         //cleanDependants(); for "UseExisting_*D" algos
         //removeSubMeshElementsAndNodes();
         loadDependentMeshes();
@@ -1641,6 +1644,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
           else
             ret = false;
         }
+        std::cout.rdbuf( coutBuffer ); // restore cout that could be redirected by algo
+
         // check if an error reported on any sub-shape
         bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
         if ( isComputeErrorSet )