MantisBT - VTK
View Issue Details
0003834VTK(No Category)public2006-10-02 12:342013-04-05 19:20
changwon lee 
Berk Geveci 
urgentminoralways
closedfixed 
 
 
0003834: memory leaks in visual studio .net
when I use vtk in MFC application which has setting "Use MFC in a Shared DLL"
many memory leaks messages are displayed.
but in "Use MFC in a Static Library"
this phenomena doesn't appear.
No tags attached.
zip sample.zip (28,379) 1969-12-31 19:00
https://www.vtk.org/Bug/file/5680/sample.zip
Issue History
2008-11-30 09:07Mathieu MalaterreAssigned ToMathieu Malaterre => David Cole
2011-01-19 09:53David ColeAssigned ToDavid Cole =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2013-04-05 19:19Berk GeveciAssigned To => Berk Geveci
2013-04-05 19:19Berk GeveciStatusbacklog => tabled
2013-04-05 19:19Berk GeveciResolutionopen => fixed
2013-04-05 19:20Berk GeveciStatustabled => closed

Notes
(0005085)
Mathieu Malaterre   
2006-10-02 18:50   
Please describe your problem with more details. Feel free to add a sample code to reproduce the issue.

BTW are you building VTK with DEBUG_LEAKS=ON ?
(0005090)
changwon lee   
2006-10-02 22:33   
vtk 5.0.2 library was builded as shared lib, debug mode and no DEBUG_LEAKS option.
MFC program is generated with standard MFC SDI application in visual studio .net 2005.
then included some vtk header and created new class and deleted it
CsampleView::CsampleView()
{
    // TODO: add construction code here
    vtkRenderWindow* renWin = vtkRenderWindow::New();
    renWin->Delete();
}
when MFC sdi application is builded with "Use MFC in a Shared DLL"
following error occurs.

sample.exe': Loaded 'C:\WINDOWS\system32\IMEKR70.IME', No symbols loaded.
'sample.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
Detected memory leaks!
Dumping objects ->
{1139} normal block at 0x0285BDF0, 36 bytes long.
 Data: < ! > 1C DE 21 01 01 00 00 00 00 CD CD CD 01 00 00 00
{1040} normal block at 0x0284E310, 31 bytes long.
 Data: <vtkWin32RenderWi> 76 74 6B 57 69 6E 33 32 52 65 6E 64 65 72 57 69
{1039} normal block at 0x0284E2B8, 27 bytes long.
 Data: <vtkWin32OpenGLRe> 76 74 6B 57 69 6E 33 32 4F 70 65 6E 47 4C 52 65

but in "Use MFC in a Static Library"
there is no error.

I have attached sample code.
(0005288)
akiyama   
2006-10-06 06:51   
That output log is reported in front of vtkInstantiatorHashTable::~vtkInstantiatorHashTable.

I thinks class name is deleted after MFC report.
That will be because of the dynamic link.