View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007004ITKpublic2008-05-13 01:352009-09-22 16:18
Reporterwen.feng.Qiu 
Assigned ToMathieu Malaterre 
PrioritynormalSeverityblockReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionITK-3-10 
Summary0007004: ITK Memory leak in gdcm::gdcmdocument.h , function ParseDES, invoke RemoveEntry, and the solved method
DescriptionWhen use gdcm::File to load DICOM , there will memory leak .
Through track the invoke-list, i found that "ParseDES" invoke the function "RemoveEntry", but this function couldn't delete correctly.
The originally "RemoveEntry", and i add the statement to solve this program.


bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
{
   const TagKey &key = entryToRemove->GetKey();
   if ( TagHT.count(key) == 1 )
   {
      TagHT.erase(key);
      delete entryToRemove;
      return true;
   }
   
   gdcmWarningMacro( "Key not present : " << key);
   return false ;
}

After modify,

bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
{
   const TagKey &key = entryToRemove->GetKey();
   if ( TagHT.count(key) == 1 )
   {
      TagHT.erase(key);
      delete entryToRemove;
      return true;
   }
// summit add: to RemoveEntry delete correctly the entryToRemove

   delete entryToRemove;
   gdcmWarningMacro( "Key not present : " << key);
   return false ;
}
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Filescxx file icon gdcmDocEntry.cxx [^] (8,658 bytes) 2008-05-13 01:35

 Relationships
has duplicate 0007003closedMathieu Malaterre ITK Memory leak in gdcm::gdcmdocument.h , function ParseDES, invoke RemoveEntry, and the solved method 

  Notes
(0014236)
Mathieu Malaterre (developer)
2008-11-30 09:00

$ cvs ci -m"BUG: Fix 0007004: ITK Memory leak in gdcm::gdcmdocument.h , function ParseDES, invoke RemoveEntry, and the solved method. Thanks to summit for report+patch"
/cvsroot/Insight/Insight/Utilities/gdcm/src/gdcmElementSet.cxx,v <-- gdcmElementSet.cxx
new revision: 1.7; previous revision: 1.6
(0014237)
Mathieu Malaterre (developer)
2008-11-30 09:00

Fixed in :
 $ cvs ci -m"BUG: Fix 0007004: ITK Memory leak in gdcm::gdcmdocument.h , function ParseDES, invoke RemoveEntry, and the solved method. Thanks to summit for report+patch" ~/Projects/Insight/Utilities/gdcm/src
/cvsroot/Insight/Insight/Utilities/gdcm/src/gdcmElementSet.cxx,v <-- gdcmElementSet.cxx
new revision: 1.7; previous revision: 1.6

 Issue History
Date Modified Username Field Change
2008-05-13 01:35 wen.feng.Qiu New Issue
2008-05-13 01:35 wen.feng.Qiu File Added: gdcmDocEntry.cxx
2008-10-06 05:33 Mathieu Malaterre Status new => assigned
2008-10-06 05:33 Mathieu Malaterre Assigned To => Mathieu Malaterre
2008-11-30 09:00 Mathieu Malaterre Note Added: 0014236
2008-11-30 09:00 Mathieu Malaterre Note Added: 0014237
2008-11-30 09:00 Mathieu Malaterre Status assigned => closed
2008-11-30 09:00 Mathieu Malaterre Resolution open => fixed
2008-11-30 09:00 Mathieu Malaterre Fixed in Version => ITK-3-10
2008-11-30 09:01 Mathieu Malaterre Relationship added has duplicate 0007003
2008-11-30 11:42 Mathieu Malaterre Status closed => resolved
2009-09-22 16:18 Mathieu Malaterre Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team