Skip to content

Commit

Permalink
WiiU: Do not crash the system when using the "Exit" menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Jun 2, 2024
1 parent 45fcb40 commit 0578303
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
# include <windows.h>
#elif defined(EMSCRIPTEN)
# include <emscripten.h>
#elif defined(__WIIU__)
# include <sysapp/launch.h>
#endif

#include "async_handler.h"
Expand Down Expand Up @@ -255,7 +257,19 @@ void Player::MainLoop() {
Scene::old_instances.clear();

if (!Transition::instance().IsActive() && Scene::instance->type == Scene::Null) {
#if defined(__WIIU__)
// Run the event loop once more because SDL cleans up the app
// after invocation of SYSLaunchMenu
if (!Player::exit_flag) {
SYSLaunchMenu();
Player::exit_flag = true;
MainLoop();
} else {
Exit();
}
#else
Exit();
#endif
return;
}

Expand Down

0 comments on commit 0578303

Please sign in to comment.