Salome HOME
Clean up of cout replaced by MESSAGE + minor corrections
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index 5ca9919acd37a1e344a1a0842ec2a7b5bcbb69b4..3eb08a85c491cba94eef110101f94a834fef3f60 100644 (file)
@@ -87,7 +87,7 @@ namespace fs=boost::filesystem;
 #define MAX_MED_GROUP_NAME_LENGTH 80
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -174,13 +174,11 @@ namespace
 #ifndef WIN32
   void deleteMeshDS(SMESHDS_Mesh* meshDS)
   {
-    //cout << "deleteMeshDS( " << meshDS << endl;
     delete meshDS;
   }
 #else
   static void* deleteMeshDS(void* meshDS)
   {
-    //cout << "deleteMeshDS( " << meshDS << endl;
     SMESHDS_Mesh* m = (SMESHDS_Mesh*)meshDS;
     if(m) {
       delete m;
@@ -241,6 +239,11 @@ SMESH_Mesh::~SMESH_Mesh()
     int result=pthread_create(&thread, NULL, deleteMeshDS, (void*)_meshDS);
 #endif
   }
+
+  if(_pool)
+    DeletePoolThreads();
+  if (!MYDEBUG)
+    fs::remove_all(tmp_folder);
 }
 
 //================================================================================
@@ -538,7 +541,7 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
   Driver_Mesh::Status status = myReader.Perform();
 #ifdef _DEBUG_
   SMESH_ComputeErrorPtr er = myReader.GetError();
-  if ( er && !er->IsOK() ) std::cout << er->myComment << std::endl;
+  if ( er && !er->IsOK() ) MESSAGE(er->myComment);
 #endif
 
   // Reading groups (sub-meshes are out of scope of MED import functionality)
@@ -1767,7 +1770,6 @@ double SMESH_Mesh::GetComputeProgress() const
         rate = algo->GetProgressByTic();
         computedCost += algoDoneCost + rate * algoNotDoneCost;
       }
-      // cout << "rate: "<<rate << " algoNotDoneCost: " << algoNotDoneCost << endl;
     }
 
   // get cost of already treated sub-meshes
@@ -1788,9 +1790,6 @@ double SMESH_Mesh::GetComputeProgress() const
       }
     }
   }
-  // cout << "Total: " << totalCost
-  //      << " computed: " << computedCost << " progress: " << computedCost / totalCost
-  //      << " nbElems: " << GetMeshDS()->GetMeshInfo().NbElements() << endl;
   return computedCost / totalCost;
 }