[vtkusers] Program terminates with error if a window is closed when rendering is going on

Francois Bertel francois.bertel at kitware.com
Tue Jun 9 15:46:04 EDT 2009


Cone.cxx has just a vtkRenderWindow but no  vtkRenderWindowInteractor.
It is the job of the vtkRenderWindowInteractor to listen to events
like WM_DELETE_WINDOW and to react accordingly.

In the case of Cone.cxx, the window is closed by the user (and the
associated system resources that go with it too), but the event is not
taken into account by the program. The rendering is then perform on
system resources that don't exist anymore, hence the error.

Solution: use a vtkRenderWindowInteractor.



On Tue, Jun 9, 2009 at 9:29 AM, Limin Fu<phoolimin at gmail.com> wrote:
> Hi,
>
> I am new to VTK. I realized this problem when I ran an example of the VTK
> toolkit from my program. It happens when a render window is closed by the
> user, when there is still a rendering process going on. The error message is
> like this:
>
> XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
>       after 3037 requests (3035 known processed) with 8 events remaining.
>
> It can be reproduced by increase the number of the looping in the
> Tutorial/Step1/Cxx/Cone.cxx, and close the rendering window before the loop
> is finished.
>
> I tried VTK5.0.4 from my linux distribution, and VTK5.4.2 downloaded from
> the website, both have this problem. How should I avoid this problem?
>
> Thanks a lot!
>
> Limin
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list