diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/core.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 54ebed2c1..bb268a319 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -305,7 +305,6 @@ struct System::Impl { is_powered_on = false; exit_lock = false; - gpu_core.reset(); services.reset(); service_manager.reset(); cheat_engine.reset(); @@ -315,6 +314,7 @@ struct System::Impl { core_timing.Shutdown(); app_loader.reset(); perf_stats.reset(); + gpu_core.reset(); kernel.Shutdown(); memory.Reset(); applet_manager.ClearAll(); @@ -421,6 +421,7 @@ struct System::Impl { bool is_async_gpu{}; ExecuteProgramCallback execute_program_callback; + ExitCallback exit_callback; std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{}; @@ -798,6 +799,18 @@ void System::ExecuteProgram(std::size_t program_index) { } } +void System::RegisterExitCallback(ExitCallback&& callback) { + impl->exit_callback = std::move(callback); +} + +void System::Exit() { + if (impl->exit_callback) { + impl->exit_callback(); + } else { + LOG_CRITICAL(Core, "exit_callback must be initialized by the frontend"); + } +} + void System::ApplySettings() { if (IsPoweredOn()) { Renderer().RefreshBaseSettings(); |