Fixed running code async

This commit is contained in:
dankito 2020-09-07 15:14:04 +02:00
parent cc9f142800
commit b98bacd94a
1 changed files with 1 additions and 5 deletions

View File

@ -6,11 +6,7 @@ import BankingUiSwift
class DispatchQueueAsyncRunner : IAsyncRunner { class DispatchQueueAsyncRunner : IAsyncRunner {
func runAsync(runnable: @escaping () -> Void) { func runAsync(runnable: @escaping () -> Void) {
let frozen = FreezerKt.freeze(obj: runnable) DispatchQueue.main.async { // we cannot run runnable on a background thread due to Kotlin Native's memory model (that objects dispatched to other threads have to be immutable)
runnable()
DispatchQueue(label: "DispatchQueueAsyncRunner", qos: .background).async {
runnable() runnable()
} }
} }