A full-featured download manager.
refactor: check pid is running before kill it
Dr_rOot8a3f510c3819
diff --git a/src/main/core/Engine.js b/src/main/core/Engine.jsindex 25285516..0a920668 100644--- a/src/main/core/Engine.js+++ b/src/main/core/Engine.js@@ -102,6 +102,14 @@ export default class Engine {// })}+ isRunning (pid) {+ try {+ return process.kill(pid, 0)+ } catch (e) {+ return e.code === 'EPERM'+ }+ }+stop () {const { pid } = this.instance.childtry {@@ -116,7 +124,7 @@ export default class Engine {forceStop (pid) {try {- if (pid) {+ if (pid && this.isRunning(pid)) {process.kill(pid)}} catch (err) {