diff options
author | gdkchan <gab.dark.100@gmail.com> | 2021-03-10 17:36:38 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 21:36:38 +0100 |
commit | 5ab5b0e709c3667ca85a6727620ff26f074e4ce5 (patch) | |
tree | 7ca72504cac33fbfabc45f54647e3e843b64be9e /Ryujinx.HLE | |
parent | dbce3455ada55822cd613095c5b16c169e76c60d (diff) |
Close ILibraryAppletAccessor handles on disposal (#2094)
Diffstat (limited to 'Ryujinx.HLE')
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs index 5f1e4c26..67e6d2ae 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/LibraryAppletCreator/ILibraryAppletAccessor.cs @@ -1,14 +1,17 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Applets; using Ryujinx.HLE.HOS.Ipc; +using Ryujinx.HLE.HOS.Kernel; using Ryujinx.HLE.HOS.Kernel.Common; using Ryujinx.HLE.HOS.Kernel.Threading; using System; namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletCreator { - class ILibraryAppletAccessor : IpcService + class ILibraryAppletAccessor : IpcService, IDisposable { + private KernelContext _kernelContext; + private IApplet _applet; private AppletSession _normalSession; @@ -24,6 +27,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib public ILibraryAppletAccessor(AppletId appletId, Horizon system) { + _kernelContext = system.KernelContext; + _stateChangedEvent = new KEvent(system.KernelContext); _normalOutDataEvent = new KEvent(system.KernelContext); _interactiveOutDataEvent = new KEvent(system.KernelContext); @@ -223,5 +228,23 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib return ResultCode.Success; } + + public void Dispose() + { + if (_stateChangedEventHandle != 0) + { + _kernelContext.Syscall.CloseHandle(_stateChangedEventHandle); + } + + if (_normalOutDataEventHandle != 0) + { + _kernelContext.Syscall.CloseHandle(_normalOutDataEventHandle); + } + + if (_interactiveOutDataEventHandle != 0) + { + _kernelContext.Syscall.CloseHandle(_interactiveOutDataEventHandle); + } + } } } |