move sdl quit calls (#842)

* move sdl quit calls

* more
This commit is contained in:
Logan McNaughton 2026-05-06 10:59:05 +02:00 committed by GitHub
parent 172d10d7cb
commit 323e8cf1f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 6 deletions

View File

@ -267,6 +267,8 @@ async fn main() -> std::io::Result<()> {
args.use_dinput,
args.deadzone.unwrap_or(ui::input::DEADZONE_DEFAULT),
);
ui::sdl_close();
return Ok(());
}
if args.list_controllers {
@ -288,7 +290,6 @@ async fn main() -> std::io::Result<()> {
ui::input::bind_input_profile(&mut config, profile, port);
}
}
unsafe { sdl3_sys::init::SDL_Quit() };
} else {
#[cfg(feature = "gui")]
{
@ -298,5 +299,6 @@ async fn main() -> std::io::Result<()> {
}
}
ui::sdl_close();
Ok(())
}

View File

@ -108,6 +108,13 @@ pub fn ttf_init() {
}
}
pub fn sdl_close() {
unsafe {
sdl3_ttf_sys::ttf::TTF_Quit();
sdl3_sys::init::SDL_Quit();
}
}
pub fn get_dirs() -> Dirs {
let exe_path = std::env::current_exe().unwrap();
let portable_dir = exe_path.parent();

View File

@ -515,7 +515,6 @@ pub fn app_window() {
ui::cheats::cheats_window(&app);
app.run().unwrap();
save_settings(&app);
unsafe { sdl3_sys::init::SDL_Quit() };
}
pub fn run_rom(

View File

@ -608,8 +608,6 @@ fn close_input_profile_window(
sdl3_ttf_sys::ttf::TTF_DestroyRendererTextEngine(text_engine);
sdl3_sys::render::SDL_DestroyRenderer(renderer);
sdl3_sys::video::SDL_DestroyWindow(window);
sdl3_ttf_sys::ttf::TTF_Quit();
sdl3_sys::init::SDL_Quit();
}
}

View File

@ -150,8 +150,6 @@ pub fn close(ui: &ui::Ui) {
unsafe {
rdp_close();
sdl3_sys::video::SDL_DestroyWindow(ui.video.window);
sdl3_ttf_sys::ttf::TTF_Quit();
sdl3_sys::init::SDL_Quit();
}
}