diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-26 00:17:08 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2019-11-26 00:17:49 +0100 |
commit | f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6 (patch) | |
tree | 2514317ed0d0ada5de3a219bdd1f5baa635760dc /src/core/hle/kernel/server_session.cpp | |
parent | Merge pull request #3160 from DarkLordZach/opt-ea-clang-fmt (diff) | |
download | yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar.gz yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar.bz2 yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar.lz yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar.xz yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.tar.zst yuzu-f6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 2994fa0ac..c7db21eb2 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -31,8 +31,6 @@ ServerSession::~ServerSession() { if (parent->port) { parent->port->ConnectionClosed(); } - - parent->server = nullptr; } ResultVal<std::shared_ptr<ServerSession>> ServerSession::Create(KernelCore& kernel, @@ -46,11 +44,13 @@ ResultVal<std::shared_ptr<ServerSession>> ServerSession::Create(KernelCore& kern } bool ServerSession::ShouldWait(const Thread* thread) const { - // Closed sessions should never wait, an error will be returned from svcReplyAndReceive. - if (parent->client == nullptr) - return false; // Wait if we have no pending requests, or if we're currently handling a request. - return pending_requesting_threads.empty() || currently_handling != nullptr; + if (auto client = parent->client.lock()) { + return pending_requesting_threads.empty() || currently_handling != nullptr; + } + + // Closed sessions should never wait, an error will be returned from svcReplyAndReceive. + return {}; } void ServerSession::Acquire(Thread* thread) { @@ -192,9 +192,9 @@ ServerSession::SessionPair ServerSession::CreateSessionPair(KernelCore& kernel, std::shared_ptr<ClientSession> client_session = std::make_shared<ClientSession>(kernel); client_session->name = name + "_Client"; - std::shared_ptr<Session> parent(new Session); - parent->client = client_session.get(); - parent->server = server_session.get(); + std::shared_ptr<Session> parent = std::make_shared<Session>(); + parent->client = client_session; + parent->server = server_session; parent->port = std::move(port); client_session->parent = parent; |