]> Creatis software - gdcm.git/commitdiff
Should avoid some memory leaks
authorjpr <jpr>
Wed, 25 May 2005 12:54:17 +0000 (12:54 +0000)
committerjpr <jpr>
Wed, 25 May 2005 12:54:17 +0000 (12:54 +0000)
src/gdcmDocument.cxx
src/gdcmFileHelper.cxx
src/gdcmPixelReadConvert.cxx

index 778e9a3854189ba48174d14f91e87e3f0432157b..95b8efec2fc3470081a5bc4c0df1da349f969901 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/05/18 10:12:07 $
-  Version:   $Revision: 1.240 $
+  Date:      $Date: 2005/05/25 12:54:17 $
+  Version:   $Revision: 1.241 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -84,7 +84,12 @@ Document::Document( std::string const &fileName )
    // Load will set it to true if sucessfull
    IsDocumentAlreadyLoaded = false;
 
-   Load(fileName); 
+   Load(fileName);
+
+   // Normaly (?) Fp should be already deleted by CloseFile()
+   if ( Fp != 0 ) 
+      delete Fp;
+   Fp = 0;    
 }
 /**
  * \brief   Canonical destructor.
index bc56a312b4f7872fa1d8a66aa70553171ac8558e..24cea2560a49241dd4fd4317543a81d07bf8f700 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2005/05/20 08:27:55 $
-  Version:   $Revision: 1.40 $
+  Date:      $Date: 2005/05/25 12:54:17 $
+  Version:   $Revision: 1.41 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -238,7 +238,7 @@ bool FileHelper::SetBinEntry(uint8_t *content, int lgth,
 ValEntry *FileHelper::InsertValEntry(std::string const &content,
                                      uint16_t group, uint16_t elem)
 {
-   return FileInternal->InsertValEntry(content,group,elem);
+   return FileInternal->InsertValEntry(content, group, elem);
 }
 
 /**
@@ -1411,6 +1411,7 @@ void FileHelper::RestoreWriteMandatory()
    Archive->Restore(0x0002,0x0001);
    Archive->Restore(0x0002,0x0002);
    Archive->Restore(0x0002,0x0003);
+   Archive->Restore(0x0002,0x0010);
    Archive->Restore(0x0002,0x0012);
    Archive->Restore(0x0002,0x0013);
    Archive->Restore(0x0002,0x0016);
index d2abc9e1b588502b67bf3daa84e8daf6fadd9c46..9827068454be20f67a7b98f9bf1ea3fd4163ef41 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/05/23 13:28:19 $
-  Version:   $Revision: 1.59 $
+  Date:      $Date: 2005/05/25 12:54:18 $
+  Version:   $Revision: 1.60 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -405,6 +405,15 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
 
    if ( IsJPEGLS )
    {
+   // WARNING : JPEG-LS is NOT the 'classical' Jpeg Lossless : 
+   // [JPEG-LS is the basis for new lossless/near-lossless compression
+   // standard for continuous-tone images intended for JPEG2000. The standard
+   // is based on the LOCO-I algorithm (LOw COmplexity LOssless COmpression
+   // for Images) developed at Hewlett-Packard Laboratories]
+   //
+   // see http://datacompression.info/JPEGLS.shtml
+   //
+
       gdcmWarningMacro( "Sorry, JPEG-LS not yet taken into account" );
       fp->seekg( JPEGInfo->GetFirstFragment()->GetOffset(), std::ios::beg);
 //    if ( ! gdcm_read_JPEGLS_file( fp,Raw ) )