From 1db3a66da376c073371a78042e4baecf467ed108 Mon Sep 17 00:00:00 2001 From: Thog Date: Thu, 26 Dec 2019 02:58:38 +0100 Subject: [PATCH] Fix LibHac.IStorage not being disposed in FileSystem proxy (#851) --- .../HOS/Services/Fs/FileSystemProxy/IStorage.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs index cc407039b..b2db08dd3 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -1,9 +1,10 @@ using LibHac; using Ryujinx.HLE.HOS.Ipc; +using System; namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { - class IStorage : IpcService + class IStorage : IpcService, IDisposable { private LibHac.Fs.IStorage _baseStorage; @@ -51,5 +52,18 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy return (ResultCode)result.Value; } + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + _baseStorage?.Dispose(); + } + } } } \ No newline at end of file