mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: streamline app initialization and enhance WebSocket cleanup logic
This commit is contained in:
@@ -408,6 +408,18 @@ pub fn run() {
|
||||
|
||||
/// Handle window destroyed events
|
||||
pub fn handle_window_destroyed() {
|
||||
AsyncHandler::spawn(|| async {
|
||||
if let Err(e) = handle::Handle::mihomo()
|
||||
.await
|
||||
.clear_all_ws_connections()
|
||||
.await
|
||||
{
|
||||
logging!(warn, Type::Window, "清理 WebSocket 连接失败: {}", e);
|
||||
} else {
|
||||
logging!(info, Type::Window, "WebSocket 连接已清理");
|
||||
}
|
||||
});
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
use crate::core::hotkey::SystemHotkey;
|
||||
|
||||
Reference in New Issue
Block a user