From: Gary S. <gi...@st...> - 2003-02-10 14:06:20
|
> Anyway, "gljDestroy failed (free)", who knows what it > does mean ? > > I have a JFrame containing a GLAnimCanvas called > "canvas", created with > GLDrawableFactory.getFactory().createGLAnimCanvas(caps, > 640, 480); > > Then, i add a GLEventListener > (canvas.addGLEventListener) on it, containing all the > init and display methods. But everytime I try to call > canvas.cvsDispose(), it tells me that gljDestroy > Failed. I know that it means he can't destroy the > GLContext, but i dunno how to correct it... > > When I Use a simple GLAnimCanvas, without > GLEventListener, this error never occur. Is it a > GLEventListener problem ? Or am i doing something > wrong ? I don't know exactly what it means but I do know where it occurs. Basically, as I'm sure you know, since the event that terminates the main window can be called at any time, then the GLAnimCanvas can be within a draw() at the time the termination is called, this causes this error to appear. The way I got around it was to insure the termination occured correctly from within the draw. For example if you have a window close event this can set a boolean flag within the canvas which if found to be true terminates the application (so effectively your canvas is responcable for terminating the application). You could also maybe set up an event listener inside the canvas to stop the OpenGL drawing. Hope this helps, Gary |