RecyclableList finalizer added to make sure that the recyclable arrays are correctly returned.
This commit is contained in:
1 parent
c2eefdfe3b
commit
cf284865e9
1 file changed
+7
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user