Skip to content

Commit 9faa7fe

Browse files
authored
Merge pull request #483 from CommunityToolkit/dev/no-finalizers
Remove unnecessary finalizers
2 parents e489e32 + 9649196 commit 9faa7fe

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

CommunityToolkit.HighPerformance/Buffers/ArrayPoolBufferWriter{T}.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ public ArrayPoolBufferWriter(ArrayPool<T> pool, int initialCapacity)
9999
this.index = 0;
100100
}
101101

102-
/// <summary>
103-
/// Finalizes an instance of the <see cref="ArrayPoolBufferWriter{T}"/> class.
104-
/// </summary>
105-
~ArrayPoolBufferWriter() => Dispose();
106-
107102
/// <inheritdoc/>
108103
Memory<T> IMemoryOwner<T>.Memory
109104
{
@@ -311,8 +306,6 @@ public void Dispose()
311306
return;
312307
}
313308

314-
GC.SuppressFinalize(this);
315-
316309
this.array = null;
317310

318311
this.pool.Return(array);

CommunityToolkit.HighPerformance/Buffers/MemoryOwner{T}.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ private MemoryOwner(int start, int length, ArrayPool<T> pool, T[] array)
7777
this.array = array;
7878
}
7979

80-
/// <summary>
81-
/// Finalizes an instance of the <see cref="MemoryOwner{T}"/> class.
82-
/// </summary>
83-
~MemoryOwner() => Dispose();
84-
8580
/// <summary>
8681
/// Gets an empty <see cref="MemoryOwner{T}"/> instance.
8782
/// </summary>
@@ -295,8 +290,6 @@ public void Dispose()
295290
return;
296291
}
297292

298-
GC.SuppressFinalize(this);
299-
300293
this.array = null;
301294

302295
this.pool.Return(array);

0 commit comments

Comments
 (0)