From 72b9a1e5d0161baa2861dc5e6ee069f900a773b4 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 23 Nov 2022 19:59:52 -0700 Subject: [PATCH] Add NonCopyableDisposable attributes where needed --- src/LibHac/FsSrv/FileSystemServer.cs | 2 ++ src/LibHac/FsSrv/Storage/GameCardService.cs | 1 + src/LibHac/FsSystem/NcaFileSystemDriver.cs | 1 + 3 files changed, 4 insertions(+) diff --git a/src/LibHac/FsSrv/FileSystemServer.cs b/src/LibHac/FsSrv/FileSystemServer.cs index 2d6d368a..4eaeaec9 100644 --- a/src/LibHac/FsSrv/FileSystemServer.cs +++ b/src/LibHac/FsSrv/FileSystemServer.cs @@ -1,4 +1,5 @@ using System; +using LibHac.Common; using LibHac.FsSrv.Impl; using LibHac.FsSrv.Storage; using LibHac.FsSystem; @@ -29,6 +30,7 @@ public class FileSystemServer : IDisposable } } +[NonCopyableDisposable] internal struct FileSystemServerGlobals : IDisposable { public HorizonClient Hos; diff --git a/src/LibHac/FsSrv/Storage/GameCardService.cs b/src/LibHac/FsSrv/Storage/GameCardService.cs index 5677bafb..2d32ea31 100644 --- a/src/LibHac/FsSrv/Storage/GameCardService.cs +++ b/src/LibHac/FsSrv/Storage/GameCardService.cs @@ -16,6 +16,7 @@ using IStorage = LibHac.Fs.IStorage; namespace LibHac.FsSrv.Storage; +[NonCopyableDisposable] internal struct GameCardServiceGlobals : IDisposable { public SdkMutexType StorageDeviceMutex; diff --git a/src/LibHac/FsSystem/NcaFileSystemDriver.cs b/src/LibHac/FsSystem/NcaFileSystemDriver.cs index 6b2d50db..a4ade503 100644 --- a/src/LibHac/FsSystem/NcaFileSystemDriver.cs +++ b/src/LibHac/FsSystem/NcaFileSystemDriver.cs @@ -87,6 +87,7 @@ public enum KeyType public class NcaFileSystemDriver : IDisposable { + [NonCopyableDisposable] public struct StorageContext : IDisposable { public bool OpenRawStorage;