Python memory leak for observers
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The PyVTKObject does not check for reference cycles in its observers, even for things as simple as an observer that is a method of the object itself. The place for the checks to be performed is PyVTKObject_Traverse, which can check each observer to see if it is a vtkPythonCommand, and if so, traverse its "obj" member which is a python object. This will allow simple reference cycles to be broken.
More complex reference cycles would require a special vtkPythonGarbageCollector class that could use VTK's ReportReferences function to traverse VTK's reference tree, looking for python objects.