IncorrectDereferenceException: illegal attempt to access non-shared ...
the object is created in
commonMain
part of the code, on a background thread.
if I switch to main thread on kotlin part it works fine. but if I switch on iOS one, this crash occurs on access to the object.
looks like
freeze()
is only available from ios part. Or am I missing some imports?
How can I freeze an object in common code?
n
nrobi
12/03/2020, 7:50 AM
Yes
freeze()
is on native currently, you can write your own
expect
in the common, which actually freezes only on the native part, does nothing on jvm
👍 1
nrobi
12/03/2020, 7:52 AM
Also if you are using ktor, and don’t mind depending on them, you can use their