Make sure to not leak copy handles passed in request (#1772)
* Make sure to not leak copy handles passed in request Following last gdkchan's PR this make sure to close copy handles that are passed by guest when it should. * fix comment copy pasta
This commit is contained in:
parent
1b053d2222
commit
0ab1c42eea
4 changed files with 23 additions and 15 deletions
|
@ -329,6 +329,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
|||
|
||||
context.ResponseData.Write((uint)NvResult.Success);
|
||||
|
||||
// Close transfer memory immediately as we don't use it.
|
||||
context.Device.System.KernelContext.Syscall.CloseHandle(transferMemHandle);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
|
@ -384,9 +387,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
|||
|
||||
if (errorCode == NvResult.Success)
|
||||
{
|
||||
KSharedMemory sharedMemory = context.Process.HandleTable.GetObject<KSharedMemory>(sharedMemoryHandle);
|
||||
|
||||
errorCode = ConvertInternalErrorCode(deviceFile.MapSharedMemory(sharedMemory, argument));
|
||||
errorCode = ConvertInternalErrorCode(deviceFile.MapSharedMemory(sharedMemoryHandle, argument));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue