X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FexOverlaysACR.cxx;h=ddcc4c69a0178ef1db8474a7b30c958f39c9f171;hb=6b17eb062f567984bf36876ddbb980731b603855;hp=9bd48c546a8720f70f479e9fe959d7f1bb19e81f;hpb=b551d44903972c0bc729caa3df97a2ce484851a7;p=gdcm.git diff --git a/Example/exOverlaysACR.cxx b/Example/exOverlaysACR.cxx index 9bd48c54..ddcc4c69 100644 --- a/Example/exOverlaysACR.cxx +++ b/Example/exOverlaysACR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: exOverlaysACR.cxx,v $ Language: C++ - Date: $Date: 2005/04/20 11:22:28 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/05/19 15:47:20 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -193,11 +193,10 @@ int main(int argc, char *argv[]) uint16_t overlayLocation; std::ostringstream str; std::string strOverlayLocation; - gdcm::File *fileToBuild; - gdcm::FileHelper *fh; + gdcm::File *fileToBuild = 0; + gdcm::FileHelper *fh = 0; - - + while ( (strOvlBitPosition = f1->GetEntryValue(currentOvlGroup, 0x0102)) != gdcm::GDCM_UNFOUND ) { @@ -275,7 +274,8 @@ while ( (strOvlBitPosition = f1->GetEntryValue(currentOvlGroup, 0x0102)) std::cout << "Failed\n" << "File in unwrittable\n"; delete fh; - delete fileToBuild; + if (fileToBuild) + delete fileToBuild; delete pixels; delete tabPixels; return 0; @@ -289,8 +289,10 @@ while ( (strOvlBitPosition = f1->GetEntryValue(currentOvlGroup, 0x0102)) } delete f1; - delete fh; - delete fileToBuild; + if (f1) + delete fh; + if (fileToBuild) + delete fileToBuild; delete pixels; delete tabPixels; return 0;