Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复在Android系统运行时,被杀后台时抛出的 InterruptedException 导致崩溃 #2474

Merged
merged 4 commits into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,12 @@ public interface MiraiConsoleImplementation : CoroutineScope {
init {
Runtime.getRuntime().addShutdownHook(thread(false, name = "Mirai Console Shutdown Hook") {
if (instanceInitialized) {
runBlocking {
shutdown()
try {
runBlocking {
shutdown()
}
} catch (_ : InterruptedException) {

}
}
})
Expand Down Expand Up @@ -509,4 +513,4 @@ public interface MiraiConsoleImplementation : CoroutineScope {
}
}
}
}
}