summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/client_session.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-11-26 00:17:08 +0100
committerbunnei <bunneidev@gmail.com>2019-11-26 00:17:49 +0100
commitf6b9b7910eb59cdc1e3aea9a1f1cb3d1cf8ae7f6 (patch)
tree2514317ed0d0ada5de3a219bdd1f5baa635760dc /src/core/hle/kernel/client_session.cpp
parentMerge pull request #3160 from DarkLordZach/opt-ea-clang-fmt (diff)
downloadyuzu-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 'src/core/hle/kernel/client_session.cpp')
-rw-r--r--src/core/hle/kernel/client_session.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp
index bc59d3306..5995a6556 100644
--- a/src/core/hle/kernel/client_session.cpp
+++ b/src/core/hle/kernel/client_session.cpp
@@ -16,20 +16,18 @@ ClientSession::ClientSession(KernelCore& kernel) : Object{kernel} {}
ClientSession::~ClientSession() {
// This destructor will be called automatically when the last ClientSession handle is closed by
// the emulated application.
- if (parent->server) {
- parent->server->ClientDisconnected();
+ if (auto server = parent->server.lock()) {
+ server->ClientDisconnected();
}
-
- parent->client = nullptr;
}
ResultCode ClientSession::SendSyncRequest(Thread* thread) {
- // Keep ServerSession alive until we're done working with it.
- if (parent->server == nullptr)
- return ERR_SESSION_CLOSED_BY_REMOTE;
-
// Signal the server session that new data is available
- return parent->server->HandleSyncRequest(SharedFrom(thread));
+ if (auto server = parent->server.lock()) {
+ return server->HandleSyncRequest(SharedFrom(thread));
+ }
+
+ return ERR_SESSION_CLOSED_BY_REMOTE;
}
} // namespace Kernel