Linux version cannot exit at all

There is a bug in 2.6.2 version of glfw that stops the app from exiting cleanly, I have upgraded to 2.7.2 where the bug is fixed.

But saying that, in the cocos2d-x code, there code is missing to exit the app when closing the window anyway, I added this to my version of CCEGLView_linux.cpp:

int windowCloseEventHandle(void) {
  CCDirector::sharedDirector()->end();

  s_pMainWindow->release();

  return GL_TRUE;
}

bool CCEGLView::Create(const char* pTitle, int iPixelWidth, int iPixelHeight, int iWidth, int iHeight, int iDepth) {
  ...

                //register the glfw mouse pos event
                glfwSetMousePosCallback(mousePosEventHandle);

                glfwSetWindowCloseCallback(windowCloseEventHandle); // <- New call here
  ...
}

This will close the window on request (correct), but this still isn’t letting the application exit to shell.

What am I missing?

Thanks,
Luke.

As well as the above code, we need the following to make sure the application exits under Linux:

int CCApplication::run()
{
 ...
    //for (;;) {
    while (CCDirector::sharedDirector()->getOpenGLView() != NULL) {
 ...
}

Change the for loop line to the while loop, otherwise run() will run forever and never exit.

Luke.