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
|
@ -1,6 +1,7 @@
|
|||
using Ryujinx.Audio;
|
||||
using Ryujinx.Cpu;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel;
|
||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||
using System;
|
||||
|
@ -10,18 +11,20 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOutManager
|
|||
{
|
||||
class IAudioOut : IpcService, IDisposable
|
||||
{
|
||||
private readonly IAalOutput _audioOut;
|
||||
private readonly KEvent _releaseEvent;
|
||||
private int _releaseEventHandle;
|
||||
private readonly int _track;
|
||||
private readonly int _clientHandle;
|
||||
private readonly KernelContext _kernelContext;
|
||||
private readonly IAalOutput _audioOut;
|
||||
private readonly KEvent _releaseEvent;
|
||||
private int _releaseEventHandle;
|
||||
private readonly int _track;
|
||||
private readonly int _clientHandle;
|
||||
|
||||
public IAudioOut(IAalOutput audioOut, KEvent releaseEvent, int track, int clientHandle)
|
||||
public IAudioOut(KernelContext kernelContext, IAalOutput audioOut, KEvent releaseEvent, int track, int clientHandle)
|
||||
{
|
||||
_audioOut = audioOut;
|
||||
_releaseEvent = releaseEvent;
|
||||
_track = track;
|
||||
_clientHandle = clientHandle;
|
||||
_kernelContext = kernelContext;
|
||||
_audioOut = audioOut;
|
||||
_releaseEvent = releaseEvent;
|
||||
_track = track;
|
||||
_clientHandle = clientHandle;
|
||||
}
|
||||
|
||||
[Command(0)]
|
||||
|
@ -217,6 +220,7 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioOutManager
|
|||
{
|
||||
if (disposing)
|
||||
{
|
||||
_kernelContext.Syscall.CloseHandle(_clientHandle);
|
||||
_audioOut.CloseTrack(_track);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue