life cycle fix

This commit is contained in:
jiahua.liu 2020-03-22 18:30:32 +08:00
parent de742bf904
commit 975ca6bb2b
2 changed files with 4 additions and 1 deletions

View File

@ -104,6 +104,7 @@ object MiraiConsole {
*/
fun stop() {
PluginManager.disableAllPlugins()
CommandManager.cancel()
try {
bots.forEach {
it.get()?.close()

View File

@ -154,7 +154,9 @@ object CommandManager : Job by {
} catch (e: Throwable) {//should never happen
e.printStackTrace()
}
processCommandQueue()
if(isActive) {
processCommandQueue()
}
}
}