Explicitly dispose ImageSharp images.
This commit is contained in:
@@ -320,8 +320,8 @@ namespace Content.Client.Parallax
|
||||
public override void Apply(Image<Rgba32> bitmap)
|
||||
{
|
||||
// Temporary buffer so we don't mess up blending.
|
||||
var buffer = new Image<Rgba32>(Configuration.Default, bitmap.Width, bitmap.Height, Rgba32.Black);
|
||||
|
||||
using (var buffer = new Image<Rgba32>(Configuration.Default, bitmap.Width, bitmap.Height, Rgba32.Black))
|
||||
{
|
||||
if (Masked)
|
||||
{
|
||||
GenPointsMasked(buffer);
|
||||
@@ -350,6 +350,7 @@ namespace Content.Client.Parallax
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GenPoints(Image<Rgba32> buffer)
|
||||
{
|
||||
|
||||
@@ -96,6 +96,8 @@ namespace Content.Client.Parallax
|
||||
image.SaveAsPng(stream);
|
||||
}
|
||||
|
||||
image.Dispose();
|
||||
|
||||
using (var stream = _resourceCache.UserData.Open(ParallaxConfigOld, FileMode.Create))
|
||||
using (var writer = new StreamWriter(stream, EncodingHelpers.UTF8))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user