[Insight-users] itk::GDCMSeriesFileNames memory leaks with MFC

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Feb 12 11:40:27 EST 2009


On Thu, Feb 12, 2009 at 4:07 PM, Lyubomir G. Zagorchev
<Lyubomir.G.Zagorchev at dartmouth.edu> wrote:
>
> Reading DICOM series with itk::GDCMSeriesFileNames causes a memory leak with MFC. I am running the CVS version of ITK on XP with a vtkMFCWindow based GUI. There is something in the string allocation that causes the leakage. The leaks correspond with the number of files in the series.  I don't want to use AfxEnableMemoryTracking(FALSE) before reading a DICOM volume with itk::GDCM... Please help!
>
> typedef itk::GDCMSeriesFileNames NamesGeneratorType;
> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
> nameGenerator->SetUseSeriesDetails(true);
> nameGenerator->SetDirectory(dirname);  // when commented out there is no memory leak

Try rerunning your example with the /delayload flag to avoid having
ITK dll being loaded before MFC's one. Please report back if you are
convinced that there is a leaks in gdcm library.

Thanks,
-- 
Mathieu


More information about the Insight-users mailing list