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();