diff options
author | Viktor Szépe <viktor@szepe.net> | 2024-01-16 01:09:00 +0100 |
---|---|---|
committer | Viktor Szépe <viktor@szepe.net> | 2024-01-16 01:09:00 +0100 |
commit | 90ab89a0b0174f8df559b79dc06a03479d959f93 (patch) | |
tree | 3d11a790e44945e309f0e68f5332b33b42e72bbb /src/core/hle/kernel/k_process.cpp | |
parent | Fix typos in arrays.xml (diff) | |
parent | Merge pull request #12681 from t895/stick-toggles (diff) | |
download | yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.gz yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.bz2 yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.lz yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.xz yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.tar.zst yuzu-90ab89a0b0174f8df559b79dc06a03479d959f93.zip |
Diffstat (limited to 'src/core/hle/kernel/k_process.cpp')
-rw-r--r-- | src/core/hle/kernel/k_process.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index 068e71dff..53735a225 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp @@ -171,6 +171,12 @@ void KProcess::Finalize() { m_resource_limit->Close(); } + // Clear expensive resources, as the destructor is not called for guest objects. + for (auto& interface : m_arm_interfaces) { + interface.reset(); + } + m_exclusive_monitor.reset(); + // Perform inherited finalization. KSynchronizationObject::Finalize(); } @@ -1233,10 +1239,10 @@ void KProcess::LoadModule(CodeSet code_set, KProcessAddress base_addr) { ReprotectSegment(code_set.DataSegment(), Svc::MemoryPermission::ReadWrite); #ifdef HAS_NCE - if (this->IsApplication() && Settings::IsNceEnabled()) { + const auto& patch = code_set.PatchSegment(); + if (this->IsApplication() && Settings::IsNceEnabled() && patch.size != 0) { auto& buffer = m_kernel.System().DeviceMemory().buffer; const auto& code = code_set.CodeSegment(); - const auto& patch = code_set.PatchSegment(); buffer.Protect(GetInteger(base_addr + code.addr), code.size, Common::MemoryPermission::Read | Common::MemoryPermission::Execute); buffer.Protect(GetInteger(base_addr + patch.addr), patch.size, |