diff options
author | Liam <byteslice@airmail.cc> | 2023-03-07 06:13:05 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-13 03:09:08 +0100 |
commit | 91fd4e30f2a12868201b08e73de299db1c3d116a (patch) | |
tree | ac85044f0554995ef6af3a3d9a4508286c2b95b3 /src/core/hle/kernel/svc/svc_session.cpp | |
parent | kernel: convert miscellaneous (diff) | |
download | yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.gz yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.bz2 yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.lz yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.xz yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.zst yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.zip |
Diffstat (limited to 'src/core/hle/kernel/svc/svc_session.cpp')
-rw-r--r-- | src/core/hle/kernel/svc/svc_session.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/core/hle/kernel/svc/svc_session.cpp b/src/core/hle/kernel/svc/svc_session.cpp index 90d680540..d5a3d0120 100644 --- a/src/core/hle/kernel/svc/svc_session.cpp +++ b/src/core/hle/kernel/svc/svc_session.cpp @@ -25,7 +25,7 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien if (session_reservation.Succeeded()) { session = T::Create(system.Kernel()); } else { - return ResultLimitReached; + R_THROW(ResultLimitReached); // // We couldn't reserve a session. Check that we support dynamically expanding the // // resource limit. @@ -77,15 +77,13 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien // Add the server session to the handle table. R_TRY(handle_table.Add(out_server, &session->GetServerSession())); - // Add the client session to the handle table. - const auto result = handle_table.Add(out_client, &session->GetClientSession()); - - if (!R_SUCCEEDED(result)) { - // Ensure that we maintain a clean handle state on exit. + // Ensure that we maintain a clean handle state on exit. + ON_RESULT_FAILURE { handle_table.Remove(*out_server); - } + }; - return result; + // Add the client session to the handle table. + R_RETURN(handle_table.Add(out_client, &session->GetClientSession())); } } // namespace @@ -94,9 +92,9 @@ Result CreateSession(Core::System& system, Handle* out_server, Handle* out_clien u64 name) { if (is_light) { // return CreateSession<KLightSession>(system, out_server, out_client, name); - return ResultNotImplemented; + R_THROW(ResultNotImplemented); } else { - return CreateSession<KSession>(system, out_server, out_client, name); + R_RETURN(CreateSession<KSession>(system, out_server, out_client, name)); } } |