View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007003ITKpublic2008-05-13 01:342009-09-22 16:19
Reporterwen.feng.Qiu 
Assigned ToMathieu Malaterre 
PrioritynormalSeverityblockReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007003: 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:34

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

  Notes
(0014238)
Mathieu Malaterre (developer)
2008-11-30 09:01

duplicate

 Issue History
Date Modified Username Field Change
2008-05-13 01:34 wen.feng.Qiu New Issue
2008-05-13 01:34 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:01 Mathieu Malaterre Relationship added duplicate of 0007004
2008-11-30 09:01 Mathieu Malaterre Note Added: 0014238
2008-11-30 09:01 Mathieu Malaterre Status assigned => closed
2008-11-30 09:01 Mathieu Malaterre Resolution open => fixed
2008-11-30 11:42 Mathieu Malaterre Status closed => resolved
2009-09-22 16:19 Mathieu Malaterre Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team