diff --git a/src/main.cpp b/src/main.cpp index a3f9c6e9..129a51d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,6 @@ #include "./start_screen.hpp" #include -#include #include #include #include @@ -29,8 +28,6 @@ int main(int argc, char** argv) { std::cerr << "SDL_Init failed (" << SDL_GetError() << ")\n"; return 1; } - // me just messing with RAII cleanup - auto sdl_scope = std::async(std::launch::deferred, &SDL_Quit); // more RAII std::unique_ptr window { @@ -86,9 +83,7 @@ int main(int argc, char** argv) { } ImGui_ImplSDL3_InitForSDLRenderer(window.get(), renderer.get()); - auto imgui_sdl_scope = std::async(std::launch::deferred, &ImGui_ImplSDL3_Shutdown); ImGui_ImplSDLRenderer3_Init(renderer.get()); - auto imgui_sdlrenderer_scope = std::async(std::launch::deferred, &ImGui_ImplSDLRenderer3_Shutdown); std::unique_ptr screen = std::make_unique(renderer.get()); @@ -213,6 +208,12 @@ int main(int argc, char** argv) { #endif } + ImGui_ImplSDLRenderer3_Shutdown(); + ImGui_ImplSDL3_Shutdown(); + ImGui::DestroyContext(); + + SDL_Quit(); + return 0; }