mirror of
https://github.com/PabloMK7/citra.git
synced 2024-11-28 02:14:07 +00:00
kernel: Release thread resource limit in Thread::Stop (#7318)
* core: Config plg_ldr after its creation * Also use service manager to retrieve the service * thread: Release resource limit in Thread::Stop * service: Undo plgldr change
This commit is contained in:
parent
0df72f3873
commit
62409f8139
3 changed files with 8 additions and 8 deletions
|
@ -449,6 +449,12 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window,
|
|||
gpu->SetInterruptHandler(
|
||||
[gsp](Service::GSP::InterruptId interrupt_id) { gsp->SignalInterrupt(interrupt_id); });
|
||||
|
||||
auto plg_ldr = Service::PLGLDR::GetService(*this);
|
||||
if (plg_ldr) {
|
||||
plg_ldr->SetEnabled(Settings::values.plugin_loader_enabled.GetValue());
|
||||
plg_ldr->SetAllowGameChangeState(Settings::values.allow_plugin_loader.GetValue());
|
||||
}
|
||||
|
||||
LOG_DEBUG(Core, "Initialized OK");
|
||||
|
||||
is_powered_on = true;
|
||||
|
|
|
@ -60,12 +60,7 @@ void Thread::Acquire(Thread* thread) {
|
|||
Thread::Thread(KernelSystem& kernel, u32 core_id)
|
||||
: WaitObject(kernel), core_id(core_id), thread_manager(kernel.GetThreadManager(core_id)) {}
|
||||
|
||||
Thread::~Thread() {
|
||||
auto process = owner_process.lock();
|
||||
if (process) {
|
||||
process->resource_limit->Release(ResourceLimitType::Thread, 1);
|
||||
}
|
||||
}
|
||||
Thread::~Thread() = default;
|
||||
|
||||
Thread* ThreadManager::GetCurrentThread() const {
|
||||
return current_thread.get();
|
||||
|
@ -101,6 +96,7 @@ void Thread::Stop() {
|
|||
((tls_address - Memory::TLS_AREA_VADDR) % Memory::CITRA_PAGE_SIZE) / Memory::TLS_ENTRY_SIZE;
|
||||
if (auto process = owner_process.lock()) {
|
||||
process->tls_slots[tls_page].reset(tls_slot);
|
||||
process->resource_limit->Release(ResourceLimitType::Thread, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,10 @@
|
|||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/plugin_3gx.h"
|
||||
#include "core/hle/ipc.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/shared_memory.h"
|
||||
#include "core/hle/service/plgldr/plgldr.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue