diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-01 10:38:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-01 10:38:20 -0500 |
| commit | 97f7a560f3905a1dd6a4e5a0a308ea752004bf08 (patch) | |
| tree | e60a69f96d16d051220b66e90906a7abeacf1064 /src/core/hle/service/kernel_helpers.cpp | |
| parent | da11c40849eb338bb77567eba2447398c4bab474 (diff) | |
| parent | 72e5552409305fe57781b83c3145fb2b66552be2 (diff) | |
Merge pull request #9832 from liamwhite/hle-mp
service: HLE multiprocess
Diffstat (limited to 'src/core/hle/service/kernel_helpers.cpp')
| -rw-r--r-- | src/core/hle/service/kernel_helpers.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/hle/service/kernel_helpers.cpp b/src/core/hle/service/kernel_helpers.cpp index 42991928e..a39ce5212 100644 --- a/src/core/hle/service/kernel_helpers.cpp +++ b/src/core/hle/service/kernel_helpers.cpp @@ -15,17 +15,24 @@ namespace Service::KernelHelpers { ServiceContext::ServiceContext(Core::System& system_, std::string name_) : kernel(system_.Kernel()) { + if (process = Kernel::GetCurrentProcessPointer(kernel); process != nullptr) { + return; + } + // Create the process. process = Kernel::KProcess::Create(kernel); ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), Kernel::KProcess::ProcessType::KernelInternal, kernel.GetSystemResourceLimit()) .IsSuccess()); + process_created = true; } ServiceContext::~ServiceContext() { - process->Close(); - process = nullptr; + if (process_created) { + process->Close(); + process = nullptr; + } } Kernel::KEvent* ServiceContext::CreateEvent(std::string&& name) { |
