From bbdab305aadf2674917864ddf65f5ac94fbd848e Mon Sep 17 00:00:00 2001 From: ericek111 Date: Thu, 9 Apr 2026 10:42:21 +0200 Subject: [PATCH] fix the shutdown segfault, closes #2 --- src/ui/Application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/Application.cpp b/src/ui/Application.cpp index de65b7e..b9caded 100644 --- a/src/ui/Application.cpp +++ b/src/ui/Application.cpp @@ -236,12 +236,14 @@ bool Application::init(int argc, char** argv) { } void Application::shutdown() { + if (!window_) return; // already shut down audio_.closeAll(); ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplSDL2_Shutdown(); ImGui::DestroyContext(); if (glContext_) { SDL_GL_DeleteContext(glContext_); glContext_ = nullptr; } - if (window_) { SDL_DestroyWindow(window_); window_ = nullptr; } + SDL_DestroyWindow(window_); + window_ = nullptr; SDL_Quit(); }