If you create a class that implements CoroutineSco...
# coroutines
b
If you create a class that implements CoroutineScope and keeps a local property to a
Job
, is the job cancelled if that object and the job are collected?
s
If you mean garbage collected: No, I don't think so. A Job is not cancelled when it's finalized. (and this wouldn't have worked on multi-platform Kotlin either, since there may not be any garbage collection)
b
Yes garbage collected. Thanks!
e
finalizers are evil. You should not be using them even on JVM
b
👍 generally agree. Just trying to understand cleanup responsibilities when you have your own CoroutineScope class that owns a Job
k
@elizarov just for my own curiosity, can you explain why finalizers are evil?
nevermind, did some reading. They are evil.