Tobi
10/08/2020, 2:28 PMThread 1: EXC_BAD_ACCESS (code=1, address=0x5fff89815c80)
, somewhere in the ktor coroutines stack.
My code so far is fairly simple:
class DoSomeWork(
private val domainUrl: String,
private val ktorClient: HttpClient,
private val onResponse: (Response) -> Unit = {_ ->}
) {
private val scope = MainScope()
operator fun invoke() {
scope.launch {
val response: Response = <http://ktorClient.post|ktorClient.post>(domainUrl) {
// . . .
}
onResponse(response)
}
}
companion object {
val json = Json {
encodeDefaults = false
ignoreUnknownKeys = true
}
}
}
Any idea what could be the reason?