mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
[hle/service] Instantly close IPC session when receiving CommandType::Close
This commit is contained in:
parent
c50d4e9820
commit
eff026ff8d
2 changed files with 10 additions and 4 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -381,11 +384,16 @@ Result ServerManager::CompleteSyncRequest(Session* session) {
|
|||
R_SUCCEED();
|
||||
}
|
||||
|
||||
if (service_res == IPC::ResultSessionClosed) {
|
||||
this->DestroySession(session);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
// Send the reply.
|
||||
res = server_session->SendReplyHLE();
|
||||
|
||||
// If the session has been closed, we're done.
|
||||
if (res == Kernel::ResultSessionClosed || service_res == IPC::ResultSessionClosed) {
|
||||
if (res == Kernel::ResultSessionClosed) {
|
||||
this->DestroySession(session);
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,6 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
|
|||
switch (ctx.GetCommandType()) {
|
||||
case IPC::CommandType::Close:
|
||||
case IPC::CommandType::TIPC_Close: {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
result = IPC::ResultSessionClosed;
|
||||
break;
|
||||
}
|
||||
|
|
@ -132,7 +130,7 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session,
|
|||
|
||||
// If emulation was shutdown, we are closing service threads, do not write the response back to
|
||||
// memory that may be shutting down as well.
|
||||
if (system.IsPoweredOn()) {
|
||||
if (system.IsPoweredOn() && result != IPC::ResultSessionClosed) {
|
||||
ctx.WriteToOutgoingCommandBuffer();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue