From 779c18d7e3a348e53cad75a9df8c8bf1d2371a4c Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 22 Jan 2008 10:52:37 +0000 Subject: [PATCH] Memory leaks --- .../Test/ParaMEDMEMTest_IntersectionDEC.cxx | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx b/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx index 678f25d59..1c12b1285 100644 --- a/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx +++ b/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx @@ -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; ielemgetField()->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; ielemgetField()->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"<