[vtkusers] VTK memory management

David Gobbi david.gobbi at gmail.com
Tue Sep 4 09:17:33 EDT 2012

On Wed, Aug 29, 2012 at 5:42 PM, José M. Rodriguez Bacallao
<jmrbcu at gmail.com> wrote:
> so, I need to keep using vtk messenger from tvtk?

There's probably an easier way to break the reference cycle by using
python weakrefs.  Note that reference cycles are only created when
the observer is a bound method.  Passing a plain old function to
AddObserver will not create a cycle.  Likewise, a plain old function
that calls a bound method via a weakref will not create a cycle.

I've submitted a patch for VTK 6 that will allow python to
automatically break observer reference cycles:

 - David

More information about the vtkusers mailing list