core/src/iosMain/kotlin/licenseplist/LicensePlistParser.kt
changeset 116 7e40819b3fe2
parent 79 79794afbbf95
--- a/core/src/iosMain/kotlin/licenseplist/LicensePlistParser.kt	Mon May 04 18:53:53 2026 -0400
+++ b/core/src/iosMain/kotlin/licenseplist/LicensePlistParser.kt	Mon May 04 23:44:20 2026 -0400
@@ -28,6 +28,7 @@
 import kotlinx.cinterop.memScoped
 import kotlinx.cinterop.ptr
 import kotlinx.cinterop.value
+import kotlinx.coroutines.suspendCancellableCoroutine
 import platform.Foundation.NSBundle
 import platform.Foundation.NSData
 import platform.Foundation.NSError
@@ -37,7 +38,6 @@
 import platform.Foundation.dataWithContentsOfURL
 import kotlin.coroutines.resume
 import kotlin.coroutines.resumeWithException
-import kotlin.coroutines.suspendCoroutine
 
 /**
  * Parse LicensePlist files
@@ -87,10 +87,11 @@
     }
 
     @OptIn(ExperimentalForeignApi::class, BetaInteropApi::class)
-    private suspend fun NSData.toPropertyList(): Any? = suspendCoroutine { cont ->
+    private suspend fun NSData.toPropertyList(): Any? = suspendCancellableCoroutine { cont ->
         val parsed = memScoped {
             val error: ObjCObjectVar<NSError?> = alloc()
-            val result = NSPropertyListSerialization.propertyListWithData(this@toPropertyList,
+            val result = NSPropertyListSerialization.propertyListWithData(
+                this@toPropertyList,
                 options = NSPropertyListMutableContainers,
                 format = null,
                 error.ptr