Merge pull request #367 from xunchahaha:dev

修复dev关闭还有进程
This commit is contained in:
xuncha
2026-03-05 14:43:25 +08:00
committed by GitHub

View File

@@ -2372,6 +2372,13 @@ app.whenReady().then(async () => {
}) })
}) })
app.on('before-quit', async () => {
// 停止 HTTP 服务器,释放 TCP 端口占用,避免进程无法退出
try { await httpService.stop() } catch {}
// 终止 wcdb Worker 线程,避免线程阻止进程退出
try { wcdbService.shutdown() } catch {}
})
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit()