summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2021-10-02 01:06:48 -0700
committerGravatar GitHub2021-10-02 01:06:48 -0700
commitae3e51c795ea72dd1eaea64d44b94afab7d74007 (patch)
tree89860f4f5df991336bab7332a77e76bb58e1047f /src/core/core.cpp
parentMerge pull request #7102 from Morph1984/remove-boxcat (diff)
parentservice: am: Make use of Exit to exit the currently running application (diff)
downloadyuzu-ae3e51c795ea72dd1eaea64d44b94afab7d74007.tar.gz
yuzu-ae3e51c795ea72dd1eaea64d44b94afab7d74007.tar.xz
yuzu-ae3e51c795ea72dd1eaea64d44b94afab7d74007.zip
Merge pull request #7093 from Morph1984/exit
core: Properly shutdown and exit the running application when ISelfController::Exit is called
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 50d5dab4b..bb268a319 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -421,6 +421,7 @@ struct System::Impl {
421 bool is_async_gpu{}; 421 bool is_async_gpu{};
422 422
423 ExecuteProgramCallback execute_program_callback; 423 ExecuteProgramCallback execute_program_callback;
424 ExitCallback exit_callback;
424 425
425 std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; 426 std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{};
426 std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{}; 427 std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{};
@@ -798,6 +799,18 @@ void System::ExecuteProgram(std::size_t program_index) {
798 } 799 }
799} 800}
800 801
802void System::RegisterExitCallback(ExitCallback&& callback) {
803 impl->exit_callback = std::move(callback);
804}
805
806void System::Exit() {
807 if (impl->exit_callback) {
808 impl->exit_callback();
809 } else {
810 LOG_CRITICAL(Core, "exit_callback must be initialized by the frontend");
811 }
812}
813
801void System::ApplySettings() { 814void System::ApplySettings() {
802 if (IsPoweredOn()) { 815 if (IsPoweredOn()) {
803 Renderer().RefreshBaseSettings(); 816 Renderer().RefreshBaseSettings();