[Insight-users] itk::GDCMSeriesFileNames memory leaks with MFC
Lyubomir G. Zagorchev
Lyubomir.G.Zagorchev at Dartmouth.edu
Thu Feb 12 10:07:55 EST 2009
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
The output messages are:
'AdaptMesh.exe': Loaded 'C:\AdaptMesh\build\debug\AdaptMesh.exe', Symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\snmpapi.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471\mfc80d.dll', Symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcp80d.dll', Symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\cahooknt.dll', Binary was not built with debug information.
First-chance exception at 0x7c91b1fa in AdaptMesh.exe: 0xC0000005: Access violation writing location 0x00000010.
'AdaptMesh.exe': Unloaded 'C:\WINDOWS\system32\cahooknt.dll'
'AdaptMesh.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.MFCLOC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_91481303\mfc80ENU.dll', Binary was not built with debug information.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\cahooknt.dll', Binary was not built with debug information.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\cahookd.dll', Binary was not built with debug information.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\MSCTF.dll', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\Program Files\Utimaco\SafeGuard Easy\SgMsgBhk.dll', Binary was not built with debug information.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'AdaptMesh.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', No symbols loaded.
'AdaptMesh.exe': Loaded 'C:\VTKBuild\bin\debug\vtkMFC.dll', Symbols loaded.
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\nvoglnt.dll', No symbols loaded.
The thread 'Win32 Thread' (0xf70) has exited with code 0 (0x0).
'AdaptMesh.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll', No symbols loaded.
'AdaptMesh.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
The thread 'Win32 Thread' (0x1b0) has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{17750} normal block at 0x03A49258, 12 bytes long.
Data: <X X > 58 92 A4 03 58 92 A4 03 CD CD CD CD
{17749} normal block at 0x03A4AD18, 108 bytes long.
Data: < Q > E4 88 0E 01 00 00 00 00 9C 51 F9 02 00 00 00 00
{17730} normal block at 0x03A49670, 12 bytes long.
Data: <p p > 70 96 A4 03 70 96 A4 03 CD CD CD CD
{17729} normal block at 0x03A4A8F8, 108 bytes long.
Data: < |3 > E4 88 0E 01 00 00 00 00 7C 33 F9 02 00 00 00 00
Object dump complete.
The program '[2328] AdaptMesh.exe: Native' has exited with code 0 (0x0).
More information about the Insight-users
mailing list