Fixed segmentation fault on exit when OpenGL version is not supported