move sdl quit calls (#842)

* move sdl quit calls

* more
This commit is contained in:
Logan McNaughton authored and GitHub committed 2026-05-06 08:59:05 +00:00
1 parent 172d10d7cb
commit 323e8cf1f0
5 files changed
+10 -6

No files matched your search

+3 -1
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(())
}
+7
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();
-1
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(
-2
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();
}
}
-2
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();
}
}