From 99d497ca7cc8203347db2459ce24d9776db4ca44 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 6 Jul 2022 13:29:32 -0700 Subject: [PATCH] Make sure to dispose some WeakRefs --- src/LibHac/FsSrv/Impl/DeepRetryFileSystem.cs | 3 ++- src/LibHac/FsSrv/Impl/FileSystemInterfaceAdapter.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LibHac/FsSrv/Impl/DeepRetryFileSystem.cs b/src/LibHac/FsSrv/Impl/DeepRetryFileSystem.cs index d615c5e5..1179a4e6 100644 --- a/src/LibHac/FsSrv/Impl/DeepRetryFileSystem.cs +++ b/src/LibHac/FsSrv/Impl/DeepRetryFileSystem.cs @@ -7,7 +7,6 @@ namespace LibHac.FsSrv.Impl; public class DeepRetryFileSystem : ForwardingFileSystem { - // ReSharper disable once NotAccessedField.Local private WeakRef _selfReference; private SharedRef _accessFailureManager; @@ -31,6 +30,8 @@ public class DeepRetryFileSystem : ForwardingFileSystem public override void Dispose() { _accessFailureManager.Destroy(); + _selfReference.Destroy(); + base.Dispose(); } diff --git a/src/LibHac/FsSrv/Impl/FileSystemInterfaceAdapter.cs b/src/LibHac/FsSrv/Impl/FileSystemInterfaceAdapter.cs index 4536f0f6..bfac1aa2 100644 --- a/src/LibHac/FsSrv/Impl/FileSystemInterfaceAdapter.cs +++ b/src/LibHac/FsSrv/Impl/FileSystemInterfaceAdapter.cs @@ -290,6 +290,7 @@ public class FileSystemInterfaceAdapter : IFileSystemSf public void Dispose() { _baseFileSystem.Destroy(); + _selfReference.Destroy(); } private static ReadOnlySpan RootDir => "/"u8;