Skip to content

Commit

Permalink
Merge pull request #33 from rickclephas/feature/kotlin-2.1.0
Browse files Browse the repository at this point in the history
Kotlin 2.1.0
  • Loading branch information
rickclephas authored Dec 8, 2024
2 parents 7d0c938 + 0a13579 commit 7ab5ae5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

allprojects {
group = "com.rickclephas.kmp"
version = "1.0.0-BETA-8"
version = "1.0.0-BETA-8-kotlin-2.1.0-RC2"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "2.0.21"
kotlin = "2.1.0"

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.rickclephas.kmp.nsexceptionkt.core

import kotlin.experimental.ExperimentalNativeApi
import kotlin.concurrent.AtomicReference
import kotlin.native.concurrent.freeze

/**
* Wraps the unhandled exception hook such that the provided [hook] is invoked
Expand All @@ -12,13 +11,13 @@ import kotlin.native.concurrent.freeze
* @see terminateWithUnhandledException
*/
@InternalNSExceptionKtApi
@OptIn(FreezingIsDeprecated::class, ExperimentalNativeApi::class)
@OptIn(ExperimentalNativeApi::class)
public fun wrapUnhandledExceptionHook(hook: (Throwable) -> Unit) {
val prevHook = AtomicReference<ReportUnhandledExceptionHook?>(null)
val wrappedHook: ReportUnhandledExceptionHook = {
hook(it)
prevHook.value?.invoke(it)
terminateWithUnhandledException(it)
}
prevHook.value = setUnhandledExceptionHook(wrappedHook.freeze())
prevHook.value = setUnhandledExceptionHook(wrappedHook)
}

0 comments on commit 7ab5ae5

Please sign in to comment.