Skip to content

Commit

Permalink
fix: memory allocation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed May 3, 2024
1 parent 0fcd236 commit f37c496
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GalaxyBudsClient/Utils/Interface/WindowIconRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace GalaxyBudsClient.Utils.Interface;

public static class WindowIconRenderer
{
private static readonly WindowIcon DefaultIcon = MakeDefaultIcon();

public static void UpdateDynamicIcon(IBasicStatusUpdate status)
{
var trayIcons = TrayIcon.GetIcons(Application.Current!);
Expand Down Expand Up @@ -54,7 +56,7 @@ public static void ResetIconToDefault()
if (trayIcons == null)
return;

trayIcons[0].Icon = MakeDefaultIcon();
trayIcons[0].Icon = DefaultIcon;
});
}

Expand Down Expand Up @@ -91,7 +93,7 @@ private static WindowIcon MakeFromBatteryLevel(int level)
return new WindowIcon(render);
}

public static WindowIcon MakeDefaultIcon()
private static WindowIcon MakeDefaultIcon()
{
return new WindowIcon(MakeDefaultBitmap());
}
Expand Down

0 comments on commit f37c496

Please sign in to comment.