diff --git a/.editorconfig b/.editorconfig index e57b39688c..ca3fee44ad 100644 --- a/.editorconfig +++ b/.editorconfig @@ -830,6 +830,9 @@ dotnet_diagnostic.CA5351.severity = warning ### Usage Rules ### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/usage-warnings +# Call GC.SuppressFinalize correctly. +dotnet_diagnostic.CA1816.severity = warning + # Rethrow to preserve stack details. dotnet_diagnostic.CA2200.severity = warning diff --git a/OpenRA.Game/Graphics/SpriteCache.cs b/OpenRA.Game/Graphics/SpriteCache.cs index bbe6bd3403..c981b5e342 100644 --- a/OpenRA.Game/Graphics/SpriteCache.cs +++ b/OpenRA.Game/Graphics/SpriteCache.cs @@ -18,7 +18,7 @@ using OpenRA.Primitives; namespace OpenRA.Graphics { - public class SpriteCache : IDisposable + public sealed class SpriteCache : IDisposable { public readonly Dictionary SheetBuilders; readonly ISpriteLoader[] loaders; diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index 01d8106164..d9739f7585 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -65,7 +65,7 @@ namespace OpenRA } /// Describes what is to be loaded in order to run a mod. - public class Manifest : IDisposable + public sealed class Manifest : IDisposable { public readonly string Id; public readonly IReadOnlyPackage Package; diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index 4b51221224..9315665f1b 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -149,7 +149,7 @@ namespace OpenRA } } - public class Map : IReadOnlyFileSystem, IDisposable + public sealed class Map : IReadOnlyFileSystem, IDisposable { public const int SupportedMapFormat = 11; public const int CurrentMapFormat = 12; diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index cdfa253ea9..e38def96ac 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -61,7 +61,7 @@ namespace OpenRA public readonly int mapformat; } - public class MapPreview : IDisposable, IReadOnlyFileSystem + public sealed class MapPreview : IDisposable, IReadOnlyFileSystem { /// Wrapper that enables map data to be replaced in an atomic fashion. sealed class InnerData diff --git a/OpenRA.Mods.Cnc/Graphics/VoxelModelSequenceLoader.cs b/OpenRA.Mods.Cnc/Graphics/VoxelModelSequenceLoader.cs index e128d579e7..5d45e236e4 100644 --- a/OpenRA.Mods.Cnc/Graphics/VoxelModelSequenceLoader.cs +++ b/OpenRA.Mods.Cnc/Graphics/VoxelModelSequenceLoader.cs @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Cnc.Graphics } } - public class VoxelModelCache : IModelCache + public sealed class VoxelModelCache : IModelCache { readonly VoxelLoader loader; readonly Dictionary> models = new();