use chunks for cleanup

This commit is contained in:
rootdarkarchon
2023-11-17 00:27:51 +01:00
parent 41e73d6fba
commit 8c8c3509d3
4 changed files with 66 additions and 44 deletions

View File

@@ -40,12 +40,16 @@ public sealed class BlockFileDataStream : Stream
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
foreach (var substream in _substreams)
if (disposing)
{
// probably unnecessary but better safe than sorry
substream.Dispose();
foreach (var substream in _substreams)
{
// probably unnecessary but better safe than sorry
substream.Dispose();
}
}
base.Dispose(disposing);
}
public override void Flush()