Browse Source

修复kill进程

Caner 2 years ago
parent
commit
783696c350
1 changed files with 1 additions and 1 deletions
  1. 1 1
      electron/main.js

+ 1 - 1
electron/main.js

@@ -132,7 +132,7 @@ class MainSerivce {
     this.contrlEvent = fork(join(__dirname, './logiControl.js'));
     this.contrlEvent = fork(join(__dirname, './logiControl.js'));
     this.contrlEvent.on('message', msg => {
     this.contrlEvent.on('message', msg => {
       if (msg.type === 'err') {
       if (msg.type === 'err') {
-        this.contrlEvent.kill('SIGHUP')
+        this.contrlEvent.kill(msg.pid)
         this.contrlEvent = null
         this.contrlEvent = null
         dialog.showMessageBox(this.mainWin, { message: '请尝试旋转方向或重新插入USB!', type: 'error', title: '连接错误' }).then(async ({ response }) => {
         dialog.showMessageBox(this.mainWin, { message: '请尝试旋转方向或重新插入USB!', type: 'error', title: '连接错误' }).then(async ({ response }) => {
           if (!response) {
           if (!response) {