Removed registering glfwTerminate with atexit.

Functions registered with atexit are called from the thread calling exit.
glfwTerminate should only be called from the main thread.  Mistakes should be
explicit.
This commit is contained in:
Camilla Berglund
2012-10-22 03:20:16 +02:00
parent 5df4df6ca4
commit d68acb78bf
13 changed files with 40 additions and 4 deletions

View File

@@ -595,6 +595,8 @@ int main(int argc, char** argv)
free(vertex_shader_src);
free(fragment_shader_src);
glfwTerminate();
exit(EXIT_FAILURE);
}
@@ -608,6 +610,8 @@ int main(int argc, char** argv)
fprintf(stderr, "ERROR: unable to resolve OpenGL function pointers\n");
free(vertex_shader_src);
free(fragment_shader_src);
glfwTerminate();
exit(EXIT_FAILURE);
}
/* Prepare opengl resources for rendering */
@@ -619,6 +623,8 @@ int main(int argc, char** argv)
{
fprintf(stderr, "ERROR: during creation of the shader program\n");
usage();
glfwTerminate();
exit(EXIT_FAILURE);
}
@@ -683,6 +689,7 @@ int main(int argc, char** argv)
}
}
glfwTerminate();
exit(EXIT_SUCCESS);
}