Skip to content

Commit 472837a

Browse files
authored
Reorder disposing of the CryptoStream and HashAlgorithm to avoid ODE (#252)
Fix #246
1 parent dcb2c73 commit 472837a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Microsoft.NET.Build.Containers/Layer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ protected override void Dispose(bool disposing)
139139
{
140140
try
141141
{
142-
hashAlgorithm.Dispose();
142+
// dispose hashAlgorithm after sha256Stream since sha256Stream references/uses it
143143
sha256Stream.Dispose();
144+
hashAlgorithm.Dispose();
145+
144146
compressionStream.Dispose();
145147
}
146148
finally

0 commit comments

Comments
 (0)