]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Memory leaks
authorrahuel <rahuel@opencascade.com>
Tue, 22 Jan 2008 10:52:37 +0000 (10:52 +0000)
committerrahuel <rahuel@opencascade.com>
Tue, 22 Jan 2008 10:52:37 +0000 (10:52 +0000)
src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx

index 678f25d59f0d3d13055f5b1ca2a1eb9a0f741038..1c12b1285bbbc81594ed5d0ba149f1473ea0e71a 100644 (file)
@@ -92,6 +92,9 @@ void ParaMEDMEMTest::testIntersectionDEC_2D()
   MEDMEM::SUPPORT* support;
   ParaMEDMEM::ParaMESH* paramesh;
   ParaMEDMEM::ParaFIELD* parafield;
+  ParaMEDMEM::ParaSUPPORT* parasupport;
+  double * value;
+  ICoCo::Field* icocofield ;
   
   string data_dir                   = getenv("MED_ROOT_DIR");
   string tmp_dir                    = getenv("TMP");
@@ -120,18 +123,21 @@ void ParaMEDMEMTest::testIntersectionDEC_2D()
     
       paramesh=new ParaMESH (*mesh,*source_group,"source mesh");
     
-      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+//      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+      parasupport=new UnstructuredParaSUPPORT( support,*source_group);
       ParaMEDMEM::ComponentTopology comptopo;
       parafield = new ParaFIELD(parasupport, comptopo);
 
       
                        int nb_local=support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
-      double * value= new double[nb_local];
+//      double * value= new double[nb_local];
+      value= new double[nb_local];
       for(int ielem=0; ielem<nb_local;ielem++)
         value[ielem]=1.0;
       parafield->getField()->setValue(value);
     
-      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
+//      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
+      icocofield=new ICoCo::MEDField(paramesh,parafield);
      
       dec.attachLocalField(icocofield);
     }
@@ -149,17 +155,20 @@ void ParaMEDMEMTest::testIntersectionDEC_2D()
       support=new MEDMEM::SUPPORT(mesh,"all elements",MED_EN::MED_CELL);
       
       paramesh=new ParaMESH (*mesh,*target_group,"target mesh");
-      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+//      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+      parasupport=new UnstructuredParaSUPPORT(support,*target_group);
       ParaMEDMEM::ComponentTopology comptopo;
       parafield = new ParaFIELD(parasupport, comptopo);
 
                        
                        int nb_local=support->getNumberOfElements(MED_EN::MED_ALL_ELEMENTS);
-      double * value= new double[nb_local];
+//      double * value= new double[nb_local];
+      value= new double[nb_local];
       for(int ielem=0; ielem<nb_local;ielem++)
         value[ielem]=0.0;
       parafield->getField()->setValue(value);
-      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
+//      ICoCo::Field* icocofield=new ICoCo::MEDField(paramesh,parafield);
+      icocofield=new ICoCo::MEDField(paramesh,parafield);
       
       dec.attachLocalField(icocofield);
     }
@@ -227,7 +236,13 @@ void ParaMEDMEMTest::testIntersectionDEC_2D()
    delete source_group;
   delete target_group;
   delete self_group;
-
+  delete mesh;
+  delete support;
+  delete paramesh;
+  delete parafield;
+  delete parasupport;
+  delete [] value;
+  delete icocofield;
  
   MPI_Barrier(MPI_COMM_WORLD);
   cout << "end of IntersectionDEC_2D test"<<endl;