hle: kernel: Unify and integrate reference tracking for KServerPort/KServerSession.

- These are not managed elsewhere, and need to be tracked and closed on emulation shutdown.
This commit is contained in:
bunnei 2022-04-06 17:44:06 -07:00
parent 5a3c38e133
commit 11febb02d6
6 changed files with 46 additions and 13 deletions

View file

@ -195,6 +195,14 @@ public:
/// Opens a port to a service previously registered with RegisterNamedService.
KClientPort* CreateNamedServicePort(std::string name);
/// Registers a server session or port with the gobal emulation state, to be freed on shutdown.
/// This is necessary because we do not emulate processes for HLE sessions and ports.
void RegisterServerObject(KAutoObject* server_object);
/// Unregisters a server session or port previously registered with RegisterServerSession when
/// it was destroyed during the current emulation session.
void UnregisterServerObject(KAutoObject* server_object);
/// Registers all kernel objects with the global emulation state, this is purely for tracking
/// leaks after emulation has been shutdown.
void RegisterKernelObject(KAutoObject* object);