hle: kernel: Remove service thread manager and use weak_ptr.

- We no longer need to queue up service threads to be destroyed.
- Fixes a race condition where a thread could be destroyed too early, which caused a crash in Pokemon Sword/Shield.
This commit is contained in:
bunnei
2021-06-07 21:10:51 -07:00
parent df91c9f5e6
commit a493ab2678
3 changed files with 8 additions and 18 deletions

View File

@ -85,8 +85,8 @@ public:
*/
void ClientDisconnected(KServerSession* session);
std::shared_ptr<ServiceThread> GetServiceThread() const {
return service_thread.lock();
std::weak_ptr<ServiceThread> GetServiceThread() const {
return service_thread;
}
protected:
@ -152,7 +152,7 @@ public:
session_handler = std::move(handler);
}
std::shared_ptr<ServiceThread> GetServiceThread() const {
std::weak_ptr<ServiceThread> GetServiceThread() const {
return session_handler->GetServiceThread();
}