[vtk] obj delete in Python

David Gobbi dgobbi at irus.rri.on.ca
Mon May 22 17:12:40 EDT 2000


Hi Randy,

The only way to guarantee that any python object is deleted
it to remove all references to it.  And that's all that that
'del' does, it un-binds the python vtkPoints object from the
name 'pts', and hence removes a reference from vtkPoints object.

Use pts.DebugOn() to see if the VTK object is deleted
when you expect.

 - David  

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Mon, 22 May 2000, Randy Heiland wrote:

> Can some Pythoneer clue me in on how to properly delete Python-VTK objects?
>  E.g.
> >>> from libVTKCommonPython import *
> >>> pts=vtkPoints()
> >>> pts.GetClassName()
> 'vtkPoints'
> >>> pts.Delete()
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> AttributeError: Delete
> >>> del pts
> 
> does 'del' really free up memory?
> 
> thanks,
> --Randy

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list