diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs index f3cb6a5e5..c1f5b44bf 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs @@ -319,7 +319,6 @@ public class UniformUnmanagedPoolMemoryAllocatorTests // additional unmanaged handles. Therefore the only invariant we can reliably assert here is // "no growth" relative to the baseline. Assert.True(UnmanagedMemoryHandle.TotalOutstandingHandles <= baselineHandles); - GC.KeepAlive(allocator); } } @@ -392,7 +391,7 @@ public class UniformUnmanagedPoolMemoryAllocatorTests private static void AllocateSingleAndForget(UniformUnmanagedMemoryPoolMemoryAllocator allocator, int length) { // Allocate and intentionally do not dispose. - IMemoryOwner? g = allocator.Allocate(length); + IMemoryOwner g = allocator.Allocate(length); // Touch the memory to ensure the buffer is actually materialized/usable. g.GetSpan()[0] = 42;