RecyclableList finalizer added to make sure that the recyclable arrays are correctly returned.

This commit is contained in:
Marek Lemańczyk committed 2023-03-16 02:24:18 +01:00
1 parent c2eefdfe3b
commit cf284865e9
1 file changed
+7
+7
View File
@@ -779,8 +779,15 @@ namespace Recyclable.Collections
IEnumerator IEnumerable.GetEnumerator() => _memoryBlocks.Enumerate(_blockSize, LongCount).GetEnumerator();
~RecyclableList()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose();
}
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
if (_capacity > 0)
{
Clear();