Skip to content

Commit af64bb5

Browse files
Properly dispose resources allocated by Bitmap. (#877)
1 parent ce65636 commit af64bb5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5959,9 +5959,12 @@ public static string RoundBorders(string imageFile, int topLeftRadius, int topRi
59595959

59605960
g.FillPath(Brushes.White, path);
59615961

5962-
using (TextureBrush br = new TextureBrush(new Bitmap(OriginalImage), WrapMode.Clamp))
5962+
using (Bitmap bitmap = new Bitmap(OriginalImage))
59635963
{
5964-
g.FillPath(br, path);
5964+
using (TextureBrush br = new TextureBrush(bitmap, WrapMode.Clamp))
5965+
{
5966+
g.FillPath(br, path);
5967+
}
59655968
}
59665969
}
59675970
}

0 commit comments

Comments
 (0)