[vtkusers] Memory leaks in vtkCellLocator
Asad Abu-Tarif
tarifa at rpi.edu
Mon Feb 11 10:19:15 EST 2002
Hi,
I've been testing several pieces of code I wrote for memory
leaks and found out that vtkCellLocaotr causes memory
leaks in my code. I even created a test code like this:
=======code with memory leak=================
vtkCellLocator *m_CellLocator;
m_CellLocator=vtkCellLocator::New();
//m_CellLocator->SetDataSet(GetDocument()->ModelCollection->GetModelSurfaces
());
//m_CellLocator->BuildLocator();
m_CellLocator->Delete();
========================================
Interestingly enough, if I uncomment the SetDataSet, the memory
leak goes away. However, if I also uncomment BuildLocator, the
memory leak comes back!!
This happens on both windows NT and XP with VC++ compiler.
I'm using VC++ debugger to detect the memory leaks by placing
memory state check points before and after the code and then
calling the difference function.
Did anyone encounter this before? I've been testing several other
pieces of code and they don't raise the flags. So, I don't think it is
a compiler bug.
I couldn't find where it is leaking with a quick look inside the
vtkCellLocator
implementation.
I'm using vtk3.2!
Thanks,
Asad Abu-Tarif
==============================================
= Asad Abu-Tarif
= Computer Engineering
= PhD Candidate, Rensselaer Polytechnic Institute (RPI)
= website: http://asad.ods.org/Professional/
= registration toolkit: http://asad.ods.org/RegMagicTKDoc/
= email: tarifa at rpi.edu
==============================================
More information about the vtkusers
mailing list