mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-02 02:24:38 +12:00
[BUG] Fix GDI Leak at open main menu (#219), version 1.0.21.3
This commit is contained in:
parent
1e330d40a8
commit
49ea3cd7fe
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.21.2")]
|
||||
[assembly: AssemblyFileVersion("1.0.21.2")]
|
||||
[assembly: AssemblyVersion("1.0.21.3")]
|
||||
[assembly: AssemblyFileVersion("1.0.21.3")]
|
||||
|
|
|
@ -112,9 +112,12 @@ namespace SystemTrayMenu.UserInterface
|
|||
if (threadsLoading)
|
||||
{
|
||||
rotationAngle += 5;
|
||||
using Bitmap bitmapLoading = new Bitmap(ImagingHelper.RotateImage(LoadingIcon.ToBitmap(), rotationAngle));
|
||||
using Bitmap bitmapLoading = LoadingIcon.ToBitmap();
|
||||
using Bitmap bitmapLoadingRotated = new Bitmap(ImagingHelper.RotateImage(bitmapLoading, rotationAngle));
|
||||
DisposeIconIfNotDefaultIcon();
|
||||
notifyIcon.Icon = Icon.FromHandle(bitmapLoading.GetHicon());
|
||||
IntPtr hIcon = bitmapLoadingRotated.GetHicon();
|
||||
notifyIcon.Icon = (Icon)Icon.FromHandle(hIcon).Clone();
|
||||
DllImports.NativeMethods.User32DestroyIcon(hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue