AW: [vtkusers] Memory leak with wxVTKRenderWindow? Please help.

Marcus Stojek stojek at part-gmbh.de
Wed May 7 05:40:44 EDT 2003


Hi,
thanks for the help. valgrind looks like a tool I would like to have
on Windows. Thanks again for your effort.

I used the DebugOn method like Charl said and all vtkObjects I am using
are unregistered and destroyed as they should. The problem seems to be
the Destroy() on the wxVTKRenderWindow. If I use WindowRemap() right after
creating the widget a new window appears which is used for rendering. Then
after destroying the widget I get all my memory back. Great.

But I don't want that new window. The vtk doc doesn't help very much.
In wxVTKRenderWindow WindowRemap is used for reparenting, but to be honest
I don't get it. How do I have to use WindowRemap to stay inside my frame for
rendering? And what exactly does WindowRemap do?

Charl mentioned that WindowRemap is one way to solve my problems. Are there
others?

Thanks,
Marcus



>If there is ANY python binding to ANY object which has the remotest
>indirect reference to the renderer or renderwindow,  the Rendererer and
>RenderWindow won't be destroyed.  This is the reference counting at
>work.

>Call the DebugOn() method of both your renderer and renderwindow each
>time so that you can see if the thing actually self-destructs when it
>should.  If it's not, it means you have a direct/indirect reference
>hanging somewhere.

>Your Destroy() on the wxVTKRenderWindow is also not the best thing to
>do: the RenderWindow might still be alive when you do that.  At the
>moment, one of the ways to take care of this is to call WindowRemap() on
>the RenderWindow contained by the wxVTKRenderWindow.  Only then can you
>call Destroy on the containing wxVTKRenderWindow.

>I am working on a new API call for the vtkRenderWindow which should
>alleviate these problems in the future.

>Thanks,
>Charl

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




More information about the vtkusers mailing list