[vtkusers] Memory Management
Berk Geveci
geveci at seas.upenn.edu
Thu Jul 13 10:21:27 EDT 2000
I think the best way to understand reference counting in vtk
is to look at the Register and UnRegister methods in
vtkObject.cxx (I am looking at the 3.1 source). These
are responsible for increasing and decreasing the reference
count of an object.
To see a case where these are used, look at the SetNthInput method
in vtkProcessObject.cxx. This is where, when an input is added to
a filter, it is asked to increment it's reference with a
input->Register(this) call. Some other classes might have
different implementations and you might need to override this (it
is virtual) to make it behave like you want.
More information about the vtkusers
mailing list