diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-28 23:38:14 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-07-21 03:54:55 +0200 |
commit | 929994132a4f39ca4ab2975caf47a2a99a19b518 (patch) | |
tree | b4109845efdac23561d43b3f7ab9478a14532594 /src/core/hle/kernel/kernel.cpp | |
parent | Merge pull request #6649 from german77/toggle_sdl (diff) | |
download | yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar.gz yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar.bz2 yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar.lz yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar.xz yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.tar.zst yuzu-929994132a4f39ca4ab2975caf47a2a99a19b518.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 64bd0c494..ee60072c2 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -142,6 +142,13 @@ struct KernelCore::Impl { // Next host thead ID to use, 0-3 IDs represent core threads, >3 represent others next_host_thread_id = Core::Hardware::NUM_CPU_CORES; + + // Track kernel objects that were not freed on shutdown + if (registered_objects.size()) { + LOG_WARNING(Kernel, "{} kernel objects were dangling on shutdown!", + registered_objects.size()); + registered_objects.clear(); + } } void InitializePhysicalCores() { @@ -656,6 +663,7 @@ struct KernelCore::Impl { /// the ConnectToPort SVC. std::unordered_map<std::string, ServiceInterfaceFactory> service_interface_factory; NamedPortTable named_ports; + std::unordered_set<KAutoObject*> registered_objects; std::unique_ptr<Core::ExclusiveMonitor> exclusive_monitor; std::vector<Kernel::PhysicalCore> cores; @@ -852,6 +860,14 @@ KClientPort* KernelCore::CreateNamedServicePort(std::string name) { return &search->second(impl->system.ServiceManager(), impl->system); } +void KernelCore::RegisterKernelObject(KAutoObject* object) { + impl->registered_objects.insert(object); +} + +void KernelCore::UnregisterKernelObject(KAutoObject* object) { + impl->registered_objects.erase(object); +} + bool KernelCore::IsValidNamedPort(NamedPortTable::const_iterator port) const { return port != impl->named_ports.cend(); } |