We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90e8f28 commit cd53589Copy full SHA for cd53589
1 file changed
TrayIconApp.cs
@@ -58,12 +58,14 @@ public TrayApplicationContext(Action onExit)
58
59
private void OnExit(object sender, EventArgs e)
60
{
61
- // 先调用 Main 中传来的退出逻辑
62
onExitAction?.Invoke();
63
- // 再关闭托盘线程
64
- ExitThread();
+ notifyIcon.Visible = false;
+ notifyIcon.Dispose();
+ trayIcon?.Dispose();
65
+ Environment.Exit(0);
66
}
67
68
+
69
protected override void ExitThreadCore()
70
71
if (notifyIcon != null)
0 commit comments