diff --git a/src/io/window.c b/src/io/window.c index 0c34df2..d76d14f 100644 --- a/src/io/window.c +++ b/src/io/window.c @@ -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; diff --git a/src/main.c b/src/main.c index 386cece..afb7fb7 100644 --- a/src/main.c +++ b/src/main.c @@ -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; }