From d8467ca6c0eff0ea0fc619043893abb0a2cebf9f Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sat, 25 Sep 2021 23:14:49 -0400 Subject: core: Add Exit and ExitCallback This allows ISelfController::Exit to stop the currently running application. This is typically used by homebrew to exit back to the homebrew menu after calling consoleExit with libnx. --- src/core/core.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 715ab88e7..a796472b2 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -387,6 +387,18 @@ public: */ void ExecuteProgram(std::size_t program_index); + /// Type used for the frontend to designate a callback for System to exit the application. + using ExitCallback = std::function; + + /** + * Registers a callback from the frontend for System to exit the application. + * @param callback Callback from the frontend to exit the application. + */ + void RegisterExitCallback(ExitCallback&& callback); + + /// Instructs the frontend to exit the application. + void Exit(); + /// Applies any changes to settings to this core instance. void ApplySettings(); -- cgit v1.2.3