0
0
Fork 0

Close audio WorkBuffer transfer memory handle (#1770)

This commit is contained in:
gdkchan 2020-12-02 17:58:20 -03:00 committed by GitHub
parent f7617cae12
commit 1b053d2222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio
ulong workBufferSize = context.RequestData.ReadUInt64(); ulong workBufferSize = context.RequestData.ReadUInt64();
ulong appletResourceUserId = context.RequestData.ReadUInt64(); ulong appletResourceUserId = context.RequestData.ReadUInt64();
KTransferMemory workBufferTransferMemory = context.Process.HandleTable.GetObject<KTransferMemory>(context.Request.HandleDesc.ToCopy[0]); int transferMemoryHandle = context.Request.HandleDesc.ToCopy[0];
KTransferMemory workBufferTransferMemory = context.Process.HandleTable.GetObject<KTransferMemory>(transferMemoryHandle);
uint processHandle = (uint)context.Request.HandleDesc.ToCopy[1]; uint processHandle = (uint)context.Request.HandleDesc.ToCopy[1];
ResultCode result = _impl.OpenAudioRenderer(context, out IAudioRenderer renderer, ref parameter, workBufferSize, appletResourceUserId, workBufferTransferMemory, processHandle); 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)); MakeObject(context, new AudioRendererServer(renderer));
} }
context.Device.System.KernelContext.Syscall.CloseHandle(transferMemoryHandle);
context.Device.System.KernelContext.Syscall.CloseHandle((int)processHandle); context.Device.System.KernelContext.Syscall.CloseHandle((int)processHandle);
return result; return result;