From e851ca9c3c9f68404229a7052f6530187378beaf Mon Sep 17 00:00:00 2001 From: Claudia Murialdo Date: Wed, 4 Oct 2023 12:52:42 -0300 Subject: [PATCH] Properly dispose resources allocated by Bitmap. --- dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs index 06fb16db1..3a68cf203 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/GXUtilsCommon.cs @@ -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); + } } } }