From: jpr Date: Fri, 4 Mar 2005 11:15:56 +0000 (+0000) Subject: To prevent some memry leaks X-Git-Tag: Version1.2.bp~836 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c139e38830c393a2de12de8c686f36f3c544774e;p=gdcm.git To prevent some memry leaks --- diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index c1e1c311..f6f222fa 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/03/04 09:45:04 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/03/04 11:15:56 $ + 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 @@ -1054,10 +1054,16 @@ BinEntry *FileHelper::CopyBinEntry(uint16_t group, uint16_t elem, DocEntry *oldE = FileInternal->GetDocEntry(group, elem); BinEntry *newE; - if( oldE ) - if( oldE->GetVR()!=vr ) - oldE = NULL; + if( oldE ) // Is this really usefull? + if( oldE->GetVR()!=vr ) + { + //oldE = NULL; + gdcmWarningMacro( " Unconsistent VR for Bin Entry : [" << oldE->GetVR() + << "] vs [" << vr << "] for " << + std::hex << group << "|" << elem); + delete oldE; + } if( oldE ) { newE = new BinEntry(oldE->GetDictEntry());