From 980e242b76586fe378de4d0ebe5d64910891747a Mon Sep 17 00:00:00 2001 From: Ghabry Date: Thu, 6 Jun 2024 02:14:19 +0200 Subject: [PATCH] Wii U: Move teardown code to atexit --- src/platform/wiiu/main.cpp | 7 ++++--- src/platform/wiiu/main.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/wiiu/main.cpp b/src/platform/wiiu/main.cpp index 16406ec4a7..a5746056b5 100644 --- a/src/platform/wiiu/main.cpp +++ b/src/platform/wiiu/main.cpp @@ -150,10 +150,11 @@ extern "C" int main(int argc, char* argv[]) { args.push_back(working_dir); } + // Setup teardown code + atexit(WiiU_Exit); + Player::Init(std::move(args)); Player::Run(); - WiiU_Exit(); - - return EXIT_SUCCESS; + return Player::exit_code; } diff --git a/src/platform/wiiu/main.h b/src/platform/wiiu/main.h index 16f91bb38c..35525cf4aa 100644 --- a/src/platform/wiiu/main.h +++ b/src/platform/wiiu/main.h @@ -16,4 +16,3 @@ */ bool WiiU_ProcessProcUI(); -void WiiU_Exit();