[BUG?] Java crashes when calling glfwTerminate()

Started by johnpaulquijano, May 12, 2016, 07:45:08

Previous topic - Next topic

johnpaulquijano

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:

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:

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 ;)

spasi

A minimal working sample (without dependencies other than LWJGL) that reproduces the issue would be very helpful.

johnpaulquijano

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.