Skip to content

Commit

Permalink
Properly dispose resources allocated by Bitmap.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiamurialdo committed Oct 4, 2023
1 parent 692396a commit e851ca9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5959,9 +5959,12 @@ public static string RoundBorders(string imageFile, int topLeftRadius, int topRi

g.FillPath(Brushes.White, path);

using (TextureBrush br = new TextureBrush(new Bitmap(OriginalImage), WrapMode.Clamp))
using (Bitmap bitmap = new Bitmap(OriginalImage))
{
g.FillPath(br, path);
using (TextureBrush br = new TextureBrush(bitmap, WrapMode.Clamp))
{
g.FillPath(br, path);
}
}
}
}
Expand Down

0 comments on commit e851ca9

Please sign in to comment.