fix: 使用 taskkill /T 终止进程树,确保子进程也被关闭
This commit is contained in:
@@ -170,7 +170,7 @@ class SDDService {
|
||||
return new Promise((resolve) => {
|
||||
log.info(`[SDDService] Stopping process ${this.processPid}...`);
|
||||
|
||||
exec(`taskkill /F /PID ${this.processPid}`, (error) => {
|
||||
exec(`taskkill /F /T /PID ${this.processPid}`, (error) => {
|
||||
this.process = null;
|
||||
this.processPid = null;
|
||||
this._isRunning = false;
|
||||
|
||||
@@ -170,7 +170,7 @@ class TerminalService {
|
||||
return new Promise((resolve) => {
|
||||
log.info(`[TerminalService] Stopping process ${this.processPid}...`);
|
||||
|
||||
exec(`taskkill /F /PID ${this.processPid}`, (error) => {
|
||||
exec(`taskkill /F /T /PID ${this.processPid}`, (error) => {
|
||||
this.process = null;
|
||||
this.processPid = null;
|
||||
this._isRunning = false;
|
||||
|
||||
Reference in New Issue
Block a user