Open Mercury-Leo opened 2 days ago
Thanks for writing this issue @Mercury-Leo. I've occassionally seen this as well. I believe it's caused by the appdomain reloading while async network requests are in progress within the native code. When the requests complete, the native code finds that the managed world it knew no longer exists (and has taken important native objects with it!).
I did a big piece of the work to fix this in #503. But to truly fix it, we also need to modify the code that starts the network requests to keep the native objects alive (via reference counting) while they're in progress. So thank you for the reminder to do that.
Sometimes, Unity will crash completely while reloading domains.
To Reproduce
Setup
Additional context
This seems to be a problem with CesiumIonSession that isn't handled while reloading domains. It causes a native crash on the C++ side in Cesium which causes Unity to crash.
This is the crash report: