fix: don't free window twice

This commit is contained in:
2025-09-15 15:07:41 +02:00
parent dd2f4c403c
commit 057b234251
2 changed files with 7 additions and 2 deletions

View File

@@ -75,6 +75,11 @@ void window_close(void) {
}
void window_free(void) {
if (!win) {
debug("window has already been freed.");
return;
}
glfwDestroyWindow(win);
render_free();
win = NULL;

View File

@@ -34,8 +34,8 @@ int main(int argc, char **argv) {
fatal("failed to initialise!");
window_loop();
window_free();
// return success, since some architectures do not follow 0=success
/* return success, since some architectures do not follow 0=success
* This action will call `quit`. */
return EXIT_SUCCESS;
}