I took the code from Phoenix as a working example. Here's what you need:
Code:
glfwGetWindowParam(GLFW_OPENED) = 1
Or:
Code:
repeat
// Main loop here..
until glfwGetWindowParam&#40;GLFW_OPENED&#41; <> 1;