Fixed small code issues

This commit is contained in:
Darth Affe 2024-07-21 22:55:38 +02:00
parent 122327532b
commit fd228af170
2 changed files with 4 additions and 4 deletions

View File

@ -24,12 +24,12 @@ public sealed class DX11ScreenCapture : AbstractScreenCapture<ColorBGRA>
#region Constants
private static readonly FeatureLevel[] FEATURE_LEVELS =
{
[
FeatureLevel.Level_11_1,
FeatureLevel.Level_11_0,
FeatureLevel.Level_10_1,
FeatureLevel.Level_10_0
};
];
#endregion
@ -54,7 +54,7 @@ public sealed class DX11ScreenCapture : AbstractScreenCapture<ColorBGRA>
private ID3D11DeviceContext? _context;
private ID3D11Texture2D? _captureTexture;
private readonly Dictionary<CaptureZone<ColorBGRA>, ZoneTextures> _textures = new();
private readonly Dictionary<CaptureZone<ColorBGRA>, ZoneTextures> _textures = [];
#endregion

View File

@ -204,7 +204,7 @@ public sealed class CaptureZone<TColor> : ICaptureZone
/// <inheritdoc />
public void Dispose()
{
if (_disposed) throw new ObjectDisposedException("The lock is already released");
ObjectDisposedException.ThrowIf(_disposed, this);
Monitor.Exit(_lock);
_disposed = true;