Skip to content

Commit

Permalink
优化托盘图标资源释放
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuLing-zhang committed Jan 17, 2024
1 parent d91ff81 commit a52d496
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/WindowMain.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using ComputerLock.Hooks;
using ComputerLock.Platforms;
using ComputerLock.Resources;
using JiuLing.CommonLibs.ExtensionMethods;
using JiuLing.CommonLibs.Log;

namespace ComputerLock;
Expand Down Expand Up @@ -128,7 +127,7 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
this.WindowState = WindowState.Minimized;
e.Cancel = true;
return;
}
}
}
private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
Expand All @@ -141,7 +140,7 @@ private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
public void Dispose()
{
_logger.Write("系统资源释放,系统关闭");
_notifyIcon.Visible = false;
_notifyIcon.Dispose();
_activityMonitor?.StopMonitoring();
_keyboardHook.Dispose();
}
Expand Down

0 comments on commit a52d496

Please sign in to comment.