Browse Source

Dispose cost manager and hashChainBox

pull/1846/head
Brian Popow 5 years ago
parent
commit
e011450a90
  1. 4
      src/ImageSharp/Formats/Webp/Lossless/BackwardReferenceEncoder.cs

4
src/ImageSharp/Formats/Webp/Lossless/BackwardReferenceEncoder.cs

@ -114,6 +114,8 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless
BackwardReferences2DLocality(width, best); BackwardReferences2DLocality(width, best);
hashChainBox?.Dispose();
return best; return best;
} }
@ -281,7 +283,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless
} }
costModel.Build(xSize, cacheBits, refs); costModel.Build(xSize, cacheBits, refs);
var costManager = new CostManager(memoryAllocator, distArrayBuffer, pixCount, costModel); using var costManager = new CostManager(memoryAllocator, distArrayBuffer, pixCount, costModel);
Span<float> costManagerCosts = costManager.Costs.GetSpan(); Span<float> costManagerCosts = costManager.Costs.GetSpan();
Span<ushort> distArray = distArrayBuffer.GetSpan(); Span<ushort> distArray = distArrayBuffer.GetSpan();

Loading…
Cancel
Save