Salome HOME
Correct some memory leaks
[modules/smesh.git] / src / DriverMED / DriverMED_W_SMESHDS_Mesh.cxx
index 1451253..1c602e3 100644 (file)
@@ -530,14 +530,11 @@ void DriverMED_W_SMESHDS_Mesh::Add()
                                        //MESSAGE ("********* Traitement de la Famille "<<-t);
 
                                        SMESHDS_SubMesh * SM = mySMESHDSMesh->MeshElements(S);
-                                       const vector<int>& indElt = SM->GetIDElements();
-                                       vector<int>::const_iterator ite=indElt.begin();
-
+                                       SMDS_Iterator<const SMDS_MeshElement*> * ite=SM->GetElements();
                                        bool plein = false;
-                                       for (; ite!=indElt.end(); ite++)
+                                       while(ite->more())
                                        {
-                                               int eltId = *ite;
-                                               mapFamille[eltId] = -t;
+                                               mapFamille[ite->next()->GetID()] = -t;
                                                plein = true;
                                        }
                                        if (plein)
@@ -576,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++)