mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
Cmd+Q, Dock "Quit" and logout/shutdown go through applicationWillTerminate, which Tauri reports only as RunEvent::Exit, never as ExitRequested. The exit handler only ran the cleanup on ExitRequested, so quitting this way left Claude Code / Codex / Gemini / Grok Build pointed at the stopped local proxy until CC Switch was started again. Run the same cleanup on RunEvent::Exit: it is spawned onto the async runtime and the main thread waits for it with an 8 s cap, so a step that needs the main thread cannot hang the quit. Restart requests also end in RunEvent::Exit; they are flagged and skipped so the restart keeps Tauri's default path.