diff options
| author | Mary <me@thog.eu> | 2020-12-03 19:19:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-03 19:19:10 +0100 |
| commit | 0ab1c42eeae48530853ec22a8790a492c254006d (patch) | |
| tree | a091e902664bd2df193d2f79d10f4cfff3bd0e87 /Ryujinx.HLE/HOS/Services/Audio/AudioOutManager | |
| parent | 1b053d2222c5c3f9b649e0fcf423457aa705ca34 (diff) | |
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
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Audio/AudioOutManager')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Audio/AudioOutManager/IAudioOut.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Audio/AudioOutManager/IAudioOut.cs b/Ryujinx.HLE/HOS/Services/Audio/AudioOutManager/IAudioOut.cs index 86e5566a..c941cf4f 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/AudioOutManager/IAudioOut.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/AudioOutManager/IAudioOut.cs @@ -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); } } |
