]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Correct some memory leaks
authorjrt <jrt>
Fri, 5 Sep 2003 11:45:54 +0000 (11:45 +0000)
committerjrt <jrt>
Fri, 5 Sep 2003 11:45:54 +0000 (11:45 +0000)
src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/SMESH/SMESH_Hexa_3D.cxx

index adcbd218dd4a74ba898b8542c721a05b6d994ec5..0c988c3d8bb85fcbc888e0e6148bf579deb99248 100644 (file)
@@ -196,6 +196,7 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
                SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
                while(itNodes->more())
                        fprintf(myFileId, "%d ", itNodes->next()->GetID());
+               delete itNodes;
        
                fprintf(myFileId, "\n");
        }
@@ -218,7 +219,8 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
                SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
                while(itNodes->more())
                        fprintf(myFileId, "%d ", itNodes->next()->GetID());
-               
+               delete itNodes; 
+
                fprintf(myFileId, "\n");
        }
        delete itVolumes;
index 5665790ad410454e3263633d426f830389f39b22..1c602e378d794a7f33ffb819c064244c2ad4506b 100644 (file)
@@ -573,12 +573,12 @@ void DriverMED_W_SMESHDS_Mesh::Add()
                                /* allocation memoire */
                                connectivite =
                                        (med_int *) malloc(sizeof(med_int) * taille * nmailles[i]);
-                               nomele =
+                               /* nomele =
                                        (char *)malloc(sizeof(char) * MED_TAILLE_PNOM *
-                                       nmailles[i] + 1);
+                                       nmailles[i] + 1);*/
+                               nomele = "";
                                numele = (med_int *) malloc(sizeof(med_int) * nmailles[i]);
                                nufael = (med_int *) malloc(sizeof(med_int) * nmailles[i]);
-                               nomele = "";
                                nbNodes = typmai[i] % 100;
 
                                for (j = 0; j < nmailles[i]; j++)
@@ -637,7 +637,6 @@ void DriverMED_W_SMESHDS_Mesh::Add()
                                /* liberation memoire */
                                free(connectivite);
                                free(numele);
-                               free(nomele);
                                free(nufael);
                                MESSAGE(" End " << typmai[i]);
                        }
index 69f036fc1f1b7ce6e2cf4fc1ec09f8a5a789f7ba..ef661bc83ac4366554edda384c660ab2329846ed 100644 (file)
@@ -439,6 +439,7 @@ bool SMESH_Hexa_3D::Compute(SMESH_Mesh & aMesh,
                        int ij1 = j1 * nbdown + i1;
                        quad->uv_grid[ij1].node = node;
                }
+               delete itf;
 
                for (int i1 = 0; i1 < nbdown; i1++)
                        for (int j1 = 0; j1 < nbright; j1++)