From: regrain Date: Fri, 21 Oct 2005 10:29:51 +0000 (+0000) Subject: * Fix memory leaks X-Git-Tag: OpenJPEG.Version1.2~269 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=928d3c30e40ab7f3d12bfd038ce8a48befcddce8;p=gdcm.git * Fix memory leaks -- BeNours --- diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 8a622d92..7cf04812 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/10/20 15:24:09 $ - Version: $Revision: 1.62 $ + Date: $Date: 2005/10/21 10:29:51 $ + Version: $Revision: 1.63 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -555,6 +555,7 @@ DictEntry *DocEntrySet::GetDictEntry(uint16_t group, uint16_t elem, { goodEntry->Register(); } + dictEntry->Unregister(); return goodEntry; } diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index bfe2a944..3357faa8 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/10/20 07:27:43 $ - Version: $Revision: 1.65 $ + Date: $Date: 2005/10/21 10:29:51 $ + Version: $Revision: 1.66 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1324,9 +1324,9 @@ void FileHelper::CheckMandatoryElements() // At the end, not to overwrite the original ones, // needed by 'Referenced SOP Instance UID', 'Referenced SOP Class UID' // 'SOP Instance UID' - CopyMandatoryEntry(0x0008,0x0018,sop); + CopyMandatoryEntry(0x0008,0x0018,sop); // 'SOP Class UID' - CopyMandatoryEntry(0x0008,0x0016,"1.2.840.10008.5.1.4.1.1.7"); + CopyMandatoryEntry(0x0008,0x0016,"1.2.840.10008.5.1.4.1.1.7"); // ---- The user will never have to take any action on the following ----. // new value for 'SOP Instance UID' diff --git a/src/gdcmRefCounter.h b/src/gdcmRefCounter.h index 23c96c0f..bb1e2b0b 100644 --- a/src/gdcmRefCounter.h +++ b/src/gdcmRefCounter.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRefCounter.h,v $ Language: C++ - Date: $Date: 2005/10/21 07:38:00 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/10/21 10:29:51 $ + 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 @@ -46,13 +46,13 @@ public: // Reference count /// Register the object /// \remarks It increments the reference counting - inline void Register(void) + inline virtual void Register(void) { RefCount++; } /// Unregister the object /// \remarks It decrements the reference counting - inline void Unregister(void) + inline virtual void Unregister(void) { RefCount--; if(RefCount==0)