LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Fool Running on June 12, 2008, 18:10:52

Title: Error running program more then once
Post by: Fool Running on June 12, 2008, 18:10:52
I'm having a strange problem when I try to run my program more then once. By more then once, I mean that I try to re-create a display, but my program never exits. The only thing it does is create a Display then destroy the display. When I run it again I get the following error:

Operating system: Linux version 2.6.22.19-desktop-2mdv
Operating system architecture: i386
Number of processors: 2
Screen adapter: null
Adapter driver version: null
Java vendor: Sun Microsystems Inc.
Java version: 1.6.0_06

Initializing OpenGL...FAILED!
org.lwjgl.LWJGLException: X Error - disp: 0x8497388 serial: 144 error: BadGC (invalid GC parameter) request_code: 60 minor_code: 0
at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler LinuxDisplay.java-286
at org.lwjgl.opengl.LinuxContextImplementation.nCreate (Native Method)
at org.lwjgl.opengl.LinuxContextImplementation.create LinuxContextImplementation.java-50
at org.lwjgl.opengl.Context.<init> Context.java-113
at org.lwjgl.opengl.Display.create Display.java-783
at org.lwjgl.opengl.Display.create Display.java-733
at starliteGames.novaEngine.renderEngine.drawingAPIs.OpenGLApi.init OpenGLApi.java-188
at starliteGames.novaEngine.MainLoopThread.initializeRenderer MainLoopThread.java-65
at starliteGames.novaEngine.MainLoopThread.run MainLoopThread.java-89
Cleaning up...Done

Note that after each failure, the serial is different (I don't know if this is important).

I have no idea what it means, so I'm not sure how to go about debugging it. ;D
Any help would be great!

EDIT: forgot to say that if I completely exit my program and start it, it will work one time again before failing with the same error.
Title: Re: Error running program more then once
Post by: Fool Running on June 12, 2008, 18:43:43
Did a little more testing. Decided to see if a simple test case would fail:
        try{
            Display.create();
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            Display.destroy();
        }

        try{
            Display.create();
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            Display.destroy();
        }


It crashes in the same way as my program, so I assume this is not a problem with my program.
There's no reason this shouldn't work, right? I'm just assuming that creating a display, destroying it, then creating it again should work.
Title: Re: Error running program more then once
Post by: Fool Running on June 16, 2008, 17:15:21
Any one else getting this (it only happens in Linux)?  Or is it just me?
Title: Re: Error running program more then once
Post by: wolf_m on June 16, 2008, 18:25:00
I'll test later and report back.
Title: Re: Error running program more then once
Post by: elias on June 16, 2008, 18:30:02
Thanks for reporting this, it's been fixed in SVN.

  - elias
Title: Re: Error running program more then once
Post by: Fool Running on June 16, 2008, 19:13:59
Quote from: elias on June 16, 2008, 18:30:02
Thanks for reporting this, it's been fixed in SVN.

  - elias
Its good to know it wasn't just me.

Thanks :)