]> Creatis software - gdcm.git/commitdiff
* Fix memory leaks
authorregrain <regrain>
Fri, 21 Oct 2005 10:29:51 +0000 (10:29 +0000)
committerregrain <regrain>
Fri, 21 Oct 2005 10:29:51 +0000 (10:29 +0000)
   -- BeNours

src/gdcmDocEntrySet.cxx
src/gdcmFileHelper.cxx
src/gdcmRefCounter.h

index 8a622d928c90107126f5d4c8c528acbb8a41a279..7cf048122aa8e6794876eb2b8cf6725d499c5421 100644 (file)
@@ -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;
 }
 
index bfe2a944a5d40bcbe15e4888e3faea10e7ca427c..3357faa8f85dde82ad697a17ba18de0a89c7d912 100644 (file)
@@ -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'
index 23c96c0fa3c521632f0544fc5a0b6f31de1c8a6c..bb1e2b0bb59824536bb6f39e76b1038ac98da9fb 100644 (file)
@@ -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)