-
-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Description
A NullReferenceException is thrown when trying to reuse an ImageBrush<T>. Looks like the source image is being disposed during the first Fill(...) call.
Steps to Reproduce
using (var src = new Image<Rgba32>(5, 5))
{
var brush = new ImageBrush<Rgba32>(src);
using (var dest = new Image<Rgba32>(10, 10))
{
dest.Mutate(c => c.Fill(brush, new Rectangle(0, 0, 10, 10)));
dest.Mutate(c => c.Fill(brush, new Rectangle(0, 0, 10, 10)));
}
}System Configuration
- ImageSharp version: current main
- Other ImageSharp packages and versions: n.a.
- Environment (Operating system, version and so on): Any
- .NET Framework version: Any
- Additional information: -