Skip to content

Commit

Permalink
Removed unnecessary method
Browse files Browse the repository at this point in the history
  • Loading branch information
lilla28 committed May 2, 2024
1 parent 0026b21 commit a9de499
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/shell/dotnet/Shell/Utilities/IconUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// * and limitations under the License.
// */

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
Expand All @@ -22,12 +21,6 @@
namespace MorganStanley.ComposeUI.Shell.Utilities;
public static class IconUtilities
{
private static void SafeDeleteObject(IntPtr? objectHandle)
{
if (objectHandle == null) return;
NativeMethods.DeleteObject((IntPtr)objectHandle);
}

public static System.Windows.Media.ImageSource ToImageSource(this Bitmap bitmap)
{
try
Expand All @@ -49,7 +42,7 @@ public static System.Windows.Media.ImageSource ToImageSource(this Bitmap bitmap)
}
finally
{
SafeDeleteObject(bitmap.GetHbitmap());
NativeMethods.DeleteObject(bitmap.GetHbitmap());
}
}

Check warning on line 47 in src/shell/dotnet/Shell/Utilities/IconUtilities.cs

View check run for this annotation

Codecov / codecov/patch

src/shell/dotnet/Shell/Utilities/IconUtilities.cs#L45-L47

Added lines #L45 - L47 were not covered by tests
}
Expand Down

0 comments on commit a9de499

Please sign in to comment.