Skip to content

Commit a52d496

Browse files
committed
优化托盘图标资源释放
1 parent d91ff81 commit a52d496

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/WindowMain.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using ComputerLock.Hooks;
44
using ComputerLock.Platforms;
55
using ComputerLock.Resources;
6-
using JiuLing.CommonLibs.ExtensionMethods;
76
using JiuLing.CommonLibs.Log;
87

98
namespace ComputerLock;
@@ -128,7 +127,7 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
128127
this.WindowState = WindowState.Minimized;
129128
e.Cancel = true;
130129
return;
131-
}
130+
}
132131
}
133132
private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
134133
{
@@ -141,7 +140,7 @@ private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
141140
public void Dispose()
142141
{
143142
_logger.Write("系统资源释放,系统关闭");
144-
_notifyIcon.Visible = false;
143+
_notifyIcon.Dispose();
145144
_activityMonitor?.StopMonitoring();
146145
_keyboardHook.Dispose();
147146
}

0 commit comments

Comments
 (0)