MantisBT - IGSTK
View Issue Details
0005663IGSTKpublic2007-09-06 15:092007-09-06 15:25
Luis Ibanez 
Luis Ibanez 
highmajoralways
confirmedopen 
0005663: GLXBadDrawable error appears when destroying an igstkView
Destroying an igstkView produces the error GLXBadDrawable when the view has been hidden
if hide() is not invoked before the destruction of the view, the error does not appears.
No tags attached.
Issue History
2007-09-06 15:09Luis IbanezNew Issue
2007-09-06 15:12Luis IbanezNote Added: 0008862
2007-09-06 15:17Luis IbanezNote Added: 0008863
2007-09-06 15:17Luis IbanezStatusnew => assigned
2007-09-06 15:17Luis IbanezAssigned To => Luis Ibanez
2007-09-06 15:18Luis IbanezNote Added: 0008864
2007-09-06 15:18Luis IbanezStatusassigned => confirmed
2007-09-06 15:25Luis IbanezNote Added: 0008865

Notes
(0008862)
Luis Ibanez   
2007-09-06 15:12   
The error only happens on Linux

and it arises from the MakeCurrent() method of the vtkXOpenGLRenderWindow class.

When the Fl_Gl_Window is hidden, its windowId becomes invalid. the vtkRenderWindow at destruction calls MakeCurrent() and finds that the windowId cannot be used.
(0008863)
Luis Ibanez   
2007-09-06 15:17   
One possible solution is to overload the "hide()" method of the igstkView and fro m it call Finalize in the render window before allowing the call to proceed to the hide() method of the superclass.

In this way the vtkRenderWindow will release the OpenGL resources when the
WindowId and DisplayId are still valid.
(0008864)
Luis Ibanez   
2007-09-06 15:18   
We have reproduced the problem,

and the solution of adding an overloaded version of hide() seems to work.
(0008865)
Luis Ibanez   
2007-09-06 15:25   
The code has been committed to the CVS repository of the main IGSTK library:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/igstkView.h?root=IGSTK&sortby=date&r2=1.33&r1=1.32 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/igstkView.cxx?root=IGSTK&sortby=date&r2=1.44&r1=1.43 [^]