diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-24 02:00:15 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:52 +0200 |
commit | 626f746971d1d3216a38b20680959df3a1f5f256 (patch) | |
tree | d9b9448732e264e84557e12d7a14a40f00cb006f /src/core/hle/kernel/k_session.cpp | |
parent | hle: kernel: Migrate KServerPort to KAutoObject. (diff) | |
download | yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar.gz yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar.bz2 yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar.lz yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar.xz yuzu-626f746971d1d3216a38b20680959df3a1f5f256.tar.zst yuzu-626f746971d1d3216a38b20680959df3a1f5f256.zip |
Diffstat (limited to 'src/core/hle/kernel/k_session.cpp')
-rw-r--r-- | src/core/hle/kernel/k_session.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/hle/kernel/k_session.cpp b/src/core/hle/kernel/k_session.cpp index ca1cf18cd..6f4276189 100644 --- a/src/core/hle/kernel/k_session.cpp +++ b/src/core/hle/kernel/k_session.cpp @@ -1,8 +1,9 @@ -// Copyright 2019 yuzu emulator team +// Copyright 2021 yuzu emulator team // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #include "common/assert.h" +#include "core/hle/kernel/k_client_port.h" #include "core/hle/kernel/k_client_session.h" #include "core/hle/kernel/k_scoped_resource_reservation.h" #include "core/hle/kernel/k_server_session.h" @@ -14,7 +15,7 @@ KSession::KSession(KernelCore& kernel) : KAutoObjectWithSlabHeapAndContainer{kernel}, server{kernel}, client{kernel} {} KSession::~KSession() = default; -void KSession::Initialize(std::string&& name_) { +void KSession::Initialize(KClientPort* port_, std::string&& name_) { // Increment reference count. // Because reference count is one on creation, this will result // in a reference count of two. Thus, when both server and client are closed @@ -37,11 +38,22 @@ void KSession::Initialize(std::string&& name_) { process = kernel.CurrentProcess(); process->Open(); + // Set our port. + port = port_; + if (port != nullptr) { + port->Open(); + } + // Mark initialized. initialized = true; } -void KSession::Finalize() {} +void KSession::Finalize() { + if (port != nullptr) { + port->OnSessionFinalized(); + port->Close(); + } +} void KSession::OnServerClosed() { if (GetState() == State::Normal) { |