Hello Guest

[BUG?] Java crashes when calling glfwTerminate()

  • 2 Replies
  • 2208 Views
[BUG?] Java crashes when calling glfwTerminate()
« on: May 12, 2016, 07:45:08 »
Hello gurus!

This is my first time to post here as I usually find a solution just searching around, but this time I found none. So my problem is that Java crashes upon calling glfwTerminate(). I call it after exiting the application loop and freeing callbacks and OpenGL resources like so:

Code: [Select]
while(!stopped)
{
    glfwPollEvents();

    //traverse scene
    //render scene, draw code goes here

    glfwSwapBuffers(displayID);
}

//free GL resources

glfwSetKeyCallback(displayID, null).free();
...
glfwTerminate();

What's interesting is that if I comment out the draw code the application exits gracefully ???. Everything works fine with rendering btw. The draw code goes like:

Code: [Select]
glBindVertexArray(vao);
glDrawElements(type, numIndices, GL_UNSIGNED_INT, 0);

This problem occurred when I switched from LWJGL 3.0.0a to LWJGL 3.0.0b and later versions including nightlies. Any insight on this will be much appreciated ;)
« Last Edit: May 12, 2016, 08:26:55 by johnpaulquijano »

*

Offline spasi

  • *****
  • 2163
    • WebHotelier
Re: [BUG?] Java crashes when calling glfwTerminate()
« Reply #1 on: May 12, 2016, 09:29:14 »
A minimal working sample (without dependencies other than LWJGL) that reproduces the issue would be very helpful.

Re: [BUG?] Java crashes when calling glfwTerminate()
« Reply #2 on: May 14, 2016, 17:57:44 »
Hi, thanks for the reply. I found out as I was building the test scene that it was an instruction in the fragment shader which causes the crash. I didn't know shader code can hinder proper disposal of the window :o.