From 2d9dfe5bceccf8175fde15ac12b2ee14c724d323 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Sun, 4 Nov 2018 09:29:28 -0500 Subject: [PATCH] Kernel: thread manager still has to be destructed first --- src/core/hle/kernel/kernel.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index f09fd99b2d..2beaaa067e 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -228,7 +228,13 @@ private: std::unique_ptr resource_limits; std::atomic next_object_id{0}; - std::unique_ptr thread_manager; + // Note: keep the member order below in order to perform correct destruction. + // Thread manager is destructed before process list in order to Stop threads and clear thread + // info from their parent processes first. Timer manager is destructed after process list + // because timers are destructed along with process list and they need to clear info from the + // timer manager. + // TODO (wwylele): refactor the cleanup sequence to make this less complicated and sensitive. + std::unique_ptr timer_manager; // TODO(Subv): Start the process ids from 10 for now, as lower PIDs are @@ -240,6 +246,8 @@ private: SharedPtr current_process; + std::unique_ptr thread_manager; + std::unique_ptr config_mem_handler; std::unique_ptr shared_page_handler; };