Login  Register

Re: Need Help Solving OpenGL/GLSL 4.4 Issues

Posted by xghost on Aug 22, 2014; 4:01am
URL: https://forum.jogamp.org/Need-Help-Solving-OpenGL-GLSL-4-4-Issues-tp4032557p4032881.html

There's also some odd behavior I've noticed when you have code that is trying to initialize OpenGL but suddenly need to exit. The following code easily reproduces the behavior:

@Override
public void init(GLAutoDrawable auto) {
	System.exit(0);
}

If the System.exit() method is called there, then the application won't exit; it will crash and actually to fail terminate. It cannot be terminated by clicking the X on the window frame or the IDE, either. The console log produced is:

X11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 1/1, reusable (open, marked uncloseable): 0, pending (open in creation order): 1)
X11Util: Open X11 Display Connections: 1
X11Util: Open[0]: NamedX11Display[:0, 0x7fceacc23a70, refCount 1, unCloseable false]

You have to -SIGKILL it from the shell to close it down.

I'm wondering if others have seen this behavior (fairly easy to try out) or if there's a better/recommended way to actually handle the graceful exit part? I'm not sure I see a reason why trying to exit within the method should cause the observed behavior.

Please let me know if I should file a new issue.

Thanks.