mirror of
https://github.com/amalthea-mc/spigot-tg-bridge.git
synced 2024-11-09 12:11:06 +00:00
Cancel and join parent job
This commit is contained in:
parent
8279fc9022
commit
df7accf52d
@ -5,6 +5,8 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.cancelAndJoin
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
open class AsyncJavaPlugin : JavaPlugin() {
|
||||
@ -17,7 +19,7 @@ open class AsyncJavaPlugin : JavaPlugin() {
|
||||
override fun onDisable() {
|
||||
runBlocking {
|
||||
onDisableAsync()
|
||||
scope.cancel()
|
||||
scope.coroutineContext[Job]?.cancelAndJoin()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user