fix(electron): potential crash on quit (#8855)

This commit is contained in:
Peng Xiao
2024-11-20 14:44:06 +08:00
committed by GitHub
parent b0ca3c6d58
commit 8689465e00
6 changed files with 42 additions and 12 deletions
@@ -13,6 +13,7 @@ import {
import type { HelperToMain, MainToHelper } from '../shared/type';
import { MessageEventChannel } from '../shared/utils';
import { beforeAppQuit } from './cleanup';
import { logger } from './logger';
const HELPER_PROCESS_PATH = path.join(__dirname, './helper.js');
@@ -65,7 +66,7 @@ class HelperProcessManager {
});
});
app.on('before-quit', () => {
beforeAppQuit(() => {
this.#process.kill();
});
}