From: malaterre Date: Mon, 31 Jan 2005 03:36:59 +0000 (+0000) Subject: BUG: Remove mem leak. X-Git-Tag: Version1.0.bp~150 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d421c554073844836da7a42877a318652f40a140;p=gdcm.git BUG: Remove mem leak. --- diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 24e59c98..0194a97c 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2005/01/21 11:40:53 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/01/31 03:36:59 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -45,7 +45,6 @@ int InternalTest(std::string const & filename, ////// Check for existence of reference baseline dicom file: std::cout << "2..."; - //FILE* testFILE = fopen( referenceFileName.c_str(), "r" ); std::ifstream testFILE( referenceFileName.c_str() ); if (! testFILE ) { @@ -55,10 +54,6 @@ int InternalTest(std::string const & filename, tested->SetWriteModeToRGB(); tested->WriteDcmExplVR( referenceFileName ); } - else - { - //fclose( testFILE ); - } testFILE.close(); ////// Step 3a: @@ -201,7 +196,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) std::string baseLineDir = GDCM_DATA_ROOT; baseLineDir += "/BaselineDicom/"; - std::ifstream* testDIR = new std::ifstream(baseLineDir.c_str(), std::ios::in | std::ios::binary); + std::ifstream testDIR(baseLineDir.c_str(), std::ios::in | std::ios::binary); if (!testDIR ) { std::cerr << " The reference baseline directory " << std::endl @@ -211,10 +206,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) << std::endl; return 1; } - else - { - testDIR->close(); - } + testDIR.close(); ////// Step 1 (see above description): std::string filename = GDCM_DATA_ROOT;