From 1b053d2222c5c3f9b649e0fcf423457aa705ca34 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 2 Dec 2020 17:58:20 -0300 Subject: [PATCH] Close audio WorkBuffer transfer memory handle (#1770) --- Ryujinx.HLE/HOS/Services/Audio/AudioRendererManagerServer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManagerServer.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManagerServer.cs index dad34363..afc9fded 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManagerServer.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioRendererManagerServer.cs @@ -30,7 +30,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio ulong workBufferSize = context.RequestData.ReadUInt64(); ulong appletResourceUserId = context.RequestData.ReadUInt64(); - KTransferMemory workBufferTransferMemory = context.Process.HandleTable.GetObject(context.Request.HandleDesc.ToCopy[0]); + int transferMemoryHandle = context.Request.HandleDesc.ToCopy[0]; + KTransferMemory workBufferTransferMemory = context.Process.HandleTable.GetObject(transferMemoryHandle); uint processHandle = (uint)context.Request.HandleDesc.ToCopy[1]; ResultCode result = _impl.OpenAudioRenderer(context, out IAudioRenderer renderer, ref parameter, workBufferSize, appletResourceUserId, workBufferTransferMemory, processHandle); @@ -40,6 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio MakeObject(context, new AudioRendererServer(renderer)); } + context.Device.System.KernelContext.Syscall.CloseHandle(transferMemoryHandle); context.Device.System.KernelContext.Syscall.CloseHandle((int)processHandle); return result;