Skip to content

Commit 248e645

Browse files
committed
fixed image loaded while Disposing
1 parent b1e1340 commit 248e645

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • IronSoftware.Drawing/IronSoftware.Drawing.Common

IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,10 +2549,12 @@ protected virtual void Dispose(bool disposing)
25492549
{
25502550
return;
25512551
}
2552-
2553-
foreach (var x in GetInternalImages() ?? [])
2552+
if (IsImageLoaded())
25542553
{
2555-
x.Dispose();
2554+
foreach (var x in GetInternalImages() ?? [])
2555+
{
2556+
x.Dispose();
2557+
}
25562558
}
25572559
_lazyImage = null;
25582560
Binary = null;

0 commit comments

Comments
 (0)