[vtkusers] Crash with subsequent creation of vtkRenderWindow in Python

Charl P. Botha c.p.botha at its.tudelft.nl
Sat Apr 5 11:04:53 EST 2003


On Sat, Apr 05, 2003 at 06:28:07PM +0300, Pearu Peterson wrote:
> 
> """
> from vtk import vtkRenderWindow
> win = vtkRenderWindow()
> win.SetSize((400,400))
> win.Render()
> raw_input('Press any key to close window: ')
> del win
> raw_input('Press any key to create a new window: ')
> win = vtkRenderWindow()
> win.DebugOn()
> win.SetSize((400,400))
> win.Render()
> raw_input('Press any key to exit: ')
> """
> 
> crashes with the following output:

It doesn't crash here: Debian, NVidia binary drivers 1.0-4191, XFree86 4.2.1,
VTK CVS, Python 2.2.1

I also tested it on my Debian laptop, XFree86 4.3.0, DRI CVS (i.e. also Mesa
5.0.1), VTK CVS, Python 2.2.1 without incident.

> I am using VTK from its CVS and Mesa 5.0.1, both built
> with gcc-2.95.4 on Debian woody.
> 
> Is the above Python code buggy or is it VTK or Mesa bug?
> What is the correct way to close a RenderWindow and open another one?
> 
> I have noticed that there is no problem if to create several
> subsequent RenderWindows but whenever one is closed before opening
> another RenderWindow, this crash occures. Any ideas?

The RenderWindow should disappear when all references (including Python
bindings) to it are removed.  Things get more complicated when you use a
vtkRenderWindow along with an external widget set, but that is not the case
here.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtkusers mailing list