mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-21 03:23:34 +00:00
Crash-on-Exit from ServiceManager Null Pointer
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -147,7 +148,7 @@ struct System::Impl {
|
|||||||
const bool must_reinitialize =
|
const bool must_reinitialize =
|
||||||
is_multicore != Settings::values.use_multi_core.GetValue() ||
|
is_multicore != Settings::values.use_multi_core.GetValue() ||
|
||||||
extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() !=
|
extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() !=
|
||||||
Settings::MemoryLayout::Memory_4Gb);
|
Settings::MemoryLayout::Memory_4Gb);
|
||||||
|
|
||||||
if (!must_reinitialize) {
|
if (!must_reinitialize) {
|
||||||
return;
|
return;
|
||||||
@@ -430,8 +431,8 @@ struct System::Impl {
|
|||||||
kernel.SuspendEmulation(true);
|
kernel.SuspendEmulation(true);
|
||||||
kernel.CloseServices();
|
kernel.CloseServices();
|
||||||
kernel.ShutdownCores();
|
kernel.ShutdownCores();
|
||||||
services.reset();
|
|
||||||
service_manager.reset();
|
// FIX: Shut down all major systems BEFORE destroying the ServiceManager.
|
||||||
fs_controller.Reset();
|
fs_controller.Reset();
|
||||||
cheat_engine.reset();
|
cheat_engine.reset();
|
||||||
telemetry_session.reset();
|
telemetry_session.reset();
|
||||||
@@ -440,6 +441,11 @@ struct System::Impl {
|
|||||||
audio_core.reset();
|
audio_core.reset();
|
||||||
gpu_core.reset();
|
gpu_core.reset();
|
||||||
host1x_core.reset();
|
host1x_core.reset();
|
||||||
|
|
||||||
|
// Now it is safe to destroy the services and the ServiceManager.
|
||||||
|
services.reset();
|
||||||
|
service_manager.reset();
|
||||||
|
|
||||||
perf_stats.reset();
|
perf_stats.reset();
|
||||||
cpu_manager.Shutdown();
|
cpu_manager.Shutdown();
|
||||||
debugger.reset();
|
debugger.reset();
|
||||||
@@ -818,7 +824,7 @@ FileSys::VirtualFilesystem System::GetFilesystem() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void System::RegisterCheatList(const std::vector<Memory::CheatEntry>& list,
|
void System::RegisterCheatList(const std::vector<Memory::CheatEntry>& list,
|
||||||
const std::array<u8, 32>& build_id, u64 main_region_begin,
|
const std::array<u8, 0x20>& build_id, u64 main_region_begin,
|
||||||
u64 main_region_size) {
|
u64 main_region_size) {
|
||||||
impl->cheat_engine = std::make_unique<Memory::CheatEngine>(*this, list, build_id);
|
impl->cheat_engine = std::make_unique<Memory::CheatEngine>(*this, list, build_id);
|
||||||
impl->cheat_engine->SetMainMemoryParameters(main_region_begin, main_region_size);
|
impl->cheat_engine->SetMainMemoryParameters(main_region_begin, main_region_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user