https://kotlinlang.org logo
Title
a

andreasmattsson

09/04/2017, 12:46 PM
I'm trying to use the Workers API but getting a "Memory leaks found" as soon as I try to pass worker arguments:
C:\Users\w64vm\kotlin-native\runtime\src\main\cpp\Memory.cpp:751: runtime assert: Memory leaks found
No args, no errors:
data class WorkerArgs(val unused: Unit = Unit)
val worker = startWorker()
val future = worker.schedule(
        TransferMode.CHECKED,
        { },
        { }
)
future.consume { _ -> }
worker.requestTermination().consume { _ ->  }
With args, prints error:
data class WorkerArgs(val unused: Unit = Unit)
val worker = startWorker()
val future = worker.schedule(
        TransferMode.CHECKED,
        { WorkerArgs() }, // <-- this line
        { }
)
future.consume { _ -> }
worker.requestTermination().consume { _ ->  }
Do I need to manually dispose the WorkerArgs instance somehow?
o

olonho

09/04/2017, 4:52 PM
nope, this is just a bug that slipped into v0.3.1, we will release v0.3.2. to fix this problem in couple days