[vtkusers] vtk memory leaks?

Mike Gagnon mike at gagnon.com
Tue Jul 2 15:13:45 EDT 2013


Hi vtk pros!

I am getting a lot of memory leaks in my code - and I've replaced every 
possible call to vtkWhateverObject::New to 
vtkSmartPointer<vtkWhateverObject>::New (and commented out all calls to 
corresponding Deletes().

I'm thinking these must be false positives.  I tried to rebuild the 
vtkCommon project with the -DVTK_DEBUG_LEAKS  flag set - and I also set 
this flag in my own project - but I don't get the window showing memory 
leaks.  Have I done this right to see memory leaks?

Also, I've copied the project settings from the sample that was built 
from a CMake-generated project.  Amongst other project settings, the 
following dlls are under the DelayLoad properties: 
vtkRendering.dll;vtkIO.dll;vtkFiltering.dll;vtkCommon.dll.  I mention 
this because I read somewhere that the order of libraries loaded somehow 
affects the memory leak reporting...

I'd like to figure out how to see zero leaks in the output window 
(VS2012) like I see in the vtk samples so that I can see when I get any 
other (real?) leaks...

Thanks a lot,
Mike



More information about the vtkusers mailing list