Skip to content

A full-featured download manager.

fix: too fast to shut down the engine

Dr_rOotee111c92ee7c
diff --git a/src/main/Application.js b/src/main/Application.js
index a17cf51e..8af0a080 100644
--- a/src/main/Application.js
+++ b/src/main/Application.js
@@ -116,10 +116,12 @@ export default class Application extends EventEmitter {
async stopEngine () {
try {
await this.engineClient.shutdown({ force: true })
+ setImmediate(() => {
+ this.engine.stop()
+ })
} catch (err) {
logger.warn('[Motrix] shutdown engine fail: ', err.message)
} finally {
- this.engine.stop()
}
}