[vtkusers] Reference counting

lzagorch at verizon.net lzagorch at verizon.net
Fri Mar 31 14:36:11 EST 2006


I noticed that when I set a polydata object as input to a mapper (the code below) the polydata’s reference count jumps from 1 to 3. Can someone explain why? Shouldn’t it be 2 instead of 3?

Thank you,

Lyubomir

 
	vtkPolyData *p3dData = vtkPolyData::New();
	p3dData->SetPoints(p3d);
	p3dData->SetVerts(cells);
	p3d->Delete();
	cells->Delete();

p3dData’s reference count = 1

	vtkPolyDataMapper *p3dMapper = vtkPolyDataMapper::New();	p3dMapper->SetInput(p3dData);

p3dData’s reference count = 3

	p3dData->Delete();

p3dData’s reference count = 2






More information about the vtkusers mailing list