mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-14 07:10:09 +08:00
Do not set state to CLOSED multiple times on close
This commit is contained in:
parent
99d232efe8
commit
faed38da9e
@ -38,9 +38,7 @@ internal open class NettyNetworkHandler(
|
||||
) : NetworkHandlerSupport(context) {
|
||||
override fun close(cause: Throwable?) {
|
||||
if (state == State.CLOSED) return // already
|
||||
setState { StateClosed(cause ?: CancellationException("Closed normally.")) }
|
||||
super.close(cause)
|
||||
// wrap an exception, more stacktrace information
|
||||
super.close(cause) // see the `init` block at line 213, just above [NettyState]
|
||||
}
|
||||
|
||||
private fun closeSuper(cause: Throwable?) = super.close(cause)
|
||||
|
Loading…
Reference in New Issue
Block a user