Skip to content

Commit fed1205

Browse files
committed
🐛: fix coroutine error when using Dispatchers.Main [release]
1 parent 978bc03 commit fed1205

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
// Kotlin support
2323
id("org.jetbrains.kotlin.jvm") version "1.5.31"
2424
// Gradle IntelliJ Plugin
25-
id("org.jetbrains.intellij") version "1.2.1"
25+
id("org.jetbrains.intellij") version "1.5.2"
2626
// Gradle Changelog Plugin
2727
id("org.jetbrains.changelog") version "1.3.0"
2828

@@ -93,6 +93,10 @@ changelog {
9393

9494
tasks {
9595

96+
buildSearchableOptions {
97+
enabled = false
98+
}
99+
96100
test {
97101
useJUnitPlatform()
98102
}

src/main/kotlin/com/github/pushpavel/autocp/common/helpers/coroutines.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import kotlinx.coroutines.CoroutineExceptionHandler
44
import kotlinx.coroutines.CoroutineScope
55
import kotlinx.coroutines.Dispatchers
66
import kotlinx.coroutines.SupervisorJob
7+
import kotlinx.coroutines.swing.Swing
78

89
val defaultExceptionHandler = CoroutineExceptionHandler { _, t -> t.printStackTrace() }
910

1011
fun mainScope(): CoroutineScope {
11-
return CoroutineScope(Dispatchers.Main + SupervisorJob() + defaultExceptionHandler)
12+
return CoroutineScope(Dispatchers.Swing + SupervisorJob() + defaultExceptionHandler)
1213
}
1314

1415
fun defaultScope(): CoroutineScope {

0 commit comments

Comments
 (0)