29f3445721
Starting with 1.7.20 freezing is deprecated. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#freezing-deprecation for details. Merge-request: KT-MR-6399 Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
13 lines
296 B
Kotlin
13 lines
296 B
Kotlin
@file:OptIn(FreezingIsDeprecated::class)
|
|
|
|
import kotlin.native.concurrent.freeze
|
|
|
|
// KT-47828
|
|
fun setHookAndThrow() {
|
|
val hook = { _: Throwable ->
|
|
println("OK. Kotlin unhandled exception hook")
|
|
}
|
|
hook.freeze()
|
|
setUnhandledExceptionHook(hook)
|
|
throw Exception("Error")
|
|
} |