mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-06-03 21:02:05 +08:00
parent
232be33754
commit
9c639bfcc5
@ -395,9 +395,14 @@ pub fn run() {
|
||||
event_handlers::handle_reopen(has_visible_windows).await;
|
||||
});
|
||||
}
|
||||
tauri::RunEvent::Exit => {
|
||||
tauri::RunEvent::Exit => AsyncHandler::block_on(async {
|
||||
// Windows session ending currently reaches Tao as WM_ENDSESSION and
|
||||
// destroys the loop without a preventable ExitRequested event.
|
||||
if !handle::Handle::global().is_exiting() {
|
||||
feat::quit().await;
|
||||
}
|
||||
logging!(info, Type::System, "Application exited");
|
||||
}
|
||||
}),
|
||||
#[allow(unused_variables)]
|
||||
tauri::RunEvent::ExitRequested { api, code, .. } => {
|
||||
if module::lightweight::is_in_lightweight_mode() && !handle::Handle::global().is_exiting() {
|
||||
@ -405,7 +410,7 @@ pub fn run() {
|
||||
} else if code.is_none() {
|
||||
api.prevent_exit();
|
||||
if !handle::Handle::global().is_exiting() {
|
||||
AsyncHandler::spawn(|| async {
|
||||
AsyncHandler::block_on(async {
|
||||
feat::quit().await;
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user