Skip to content

Commit

Permalink
Merge pull request #534 from denisivan0v/denisivan0v/array-pool-usage…
Browse files Browse the repository at this point in the history
…-fix

Disposing data chunk instead of explicit returning it to ArrayPool in PngDecoderCore.Identify
  • Loading branch information
JimBobSquarePants authored Apr 18, 2018
2 parents 3bb07dd + 511bdc6 commit c2e898a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ImageSharp/Formats/Png/PngDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,7 @@ public IImageInfo Identify(Stream stream)
}
finally
{
// Data is rented in ReadChunkData()
if (chunk.Data != null)
{
ArrayPool<byte>.Shared.Return(chunk.Data.Array);
}
chunk.Data?.Dispose(); // Data is rented in ReadChunkData()
}
}
}
Expand Down

0 comments on commit c2e898a

Please sign in to comment.