Browse Source

Fix CA1513

pull/2583/head
Stefan Nikolei 2 years ago
parent
commit
290906a752
  1. 10
      src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs

10
src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs

@ -57,15 +57,7 @@ internal class SharedArrayPoolBuffer<T> : ManagedBufferBase<T>, IRefCounted
[Conditional("DEBUG")] [Conditional("DEBUG")]
[MemberNotNull(nameof(Array))] [MemberNotNull(nameof(Array))]
private void CheckDisposed() private void CheckDisposed() => ObjectDisposedException.ThrowIf(this.Array == null, this.Array);
{
#pragma warning disable CA1513
if (this.Array == null)
{
throw new ObjectDisposedException("SharedArrayPoolBuffer");
}
#pragma warning restore CA1513
}
private sealed class LifetimeGuard : RefCountedMemoryLifetimeGuard private sealed class LifetimeGuard : RefCountedMemoryLifetimeGuard
{ {

Loading…
Cancel
Save