修复删除js时自动卸载不完全

This commit is contained in:
UCPr 2024-03-19 20:23:28 +08:00
parent de3e7f377c
commit ca96589af2
1 changed files with 5 additions and 2 deletions

View File

@ -750,9 +750,12 @@ class PluginsLoader {
logger.mark(`[卸载插件][${dirName}][${appName}]`) logger.mark(`[卸载插件][${dirName}][${appName}]`)
/** 停止更新监听 */ /** 停止更新监听 */
this.watcher[`${dirName}.${appName}`].removeAllListeners('change') this.watcher[`${dirName}.${appName}`].removeAllListeners('change')
for (const i in this.priority) // lodash.remove(this.priority, { key })
if (this.priority[i].key == key) for (let i = this.priority.length - 1; i >= 0; i--) {
if (this.priority[i].key === key) {
this.priority.splice(i, 1) this.priority.splice(i, 1)
}
}
}) })
this.watcher[`${dirName}.${appName}`] = watcher this.watcher[`${dirName}.${appName}`] = watcher
} }