handle window exits more gracefully and appropriately.

This commit is contained in:
2025-09-15 14:15:40 +02:00
parent 1e10fec9c6
commit dc3abf992b
5 changed files with 41 additions and 8 deletions

View File

@@ -14,6 +14,10 @@ static void error_callback(int err, const char *const msg) {
}
static void quit(void) {
window_free();
/* terminates GLFW; destroying any
* remaining windows, or other resources held by GLFW. */
glfwTerminate();
}
@@ -30,7 +34,7 @@ int main(int argc, char **argv) {
fatal("failed to initialise!");
window_loop();
quit();
window_free();
// return success, since some architectures do not follow 0=success
return EXIT_SUCCESS;