hle: kernel: Cleanup shutdown of persistent kernel objects.

This commit is contained in:
bunnei 2021-04-23 17:00:46 -07:00
parent 626f746971
commit 39a8dba9a6
1 changed files with 12 additions and 14 deletions

View File

@ -129,20 +129,18 @@ struct KernelCore::Impl {
exclusive_monitor.reset(); exclusive_monitor.reset();
hid_shared_mem->Close(); // Cleanup persistent kernel objects
hid_shared_mem = nullptr; auto CleanupObject = [](KAutoObject* obj) {
if (obj) {
font_shared_mem->Close(); obj->Close();
font_shared_mem = nullptr; obj = nullptr;
}
irs_shared_mem->Close(); };
irs_shared_mem = nullptr; CleanupObject(hid_shared_mem);
CleanupObject(font_shared_mem);
time_shared_mem->Close(); CleanupObject(irs_shared_mem);
time_shared_mem = nullptr; CleanupObject(time_shared_mem);
CleanupObject(system_resource_limit);
system_resource_limit->Close();
system_resource_limit = nullptr;
// Next host thead ID to use, 0-3 IDs represent core threads, >3 represent others // Next host thead ID to use, 0-3 IDs represent core threads, >3 represent others
next_host_thread_id = Core::Hardware::NUM_CPU_CORES; next_host_thread_id = Core::Hardware::NUM_CPU_CORES;