From c9991fb0ad87c66c8fd48e472e7cc762fa18a7f5 Mon Sep 17 00:00:00 2001 From: Patrick Cleaveliln Date: Fri, 25 Jul 2025 02:38:12 +0000 Subject: [PATCH] fix segfault on quit --- src/main.odin | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.odin b/src/main.odin index 6a015cc..8a1c9f6 100644 --- a/src/main.odin +++ b/src/main.odin @@ -286,6 +286,9 @@ main :: proc() { log.error("SDL failed to initialize:", sdl2.GetError()); return; } + defer { + sdl2.Quit(); + } if ttf.Init() < 0 { log.error("SDL_TTF failed to initialize:", ttf.GetError()); @@ -502,6 +505,4 @@ main :: proc() { runtime.free_all(context.temp_allocator); } - - sdl2.Quit(); }