CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
347 stars 83 forks source link

option to 'Terrain Refresh instead of Application Termination/Crash' #447

Closed electrum-bowie closed 6 months ago

electrum-bowie commented 6 months ago

"It seems we're in CesiumForUnityNative::Cesium3DTilesetImpl::Update and then "something" goes wrong and there's a crash"

posted by @kring in here

What about a quick option to just clean cached memory and refresh the terrain when "something goes wrong in the code" instead of App Termination? I feel like this option could fully solve all unsolved crashes (except the out of memory one). And fortunately it is the easiest possible implementation :D, just replace the Application.Quit with Terrain Refresh and other additional optimisations if that option is enabled! I genuinely hope that this helps more people than just me 😝.

kring commented 6 months ago

We're not purposely exiting the application. Rather, an access violation or similar is causing the process to terminate. Handling such a case is not really viable; the only proper solution is to fix the bug that's causing the access violation. And fixing the bug requires being able to identify what caused it, or at least have a way to reproduce it. So anything you can do to help there - detailed steps for reproducing, a better call stack from a debug build - would be much appreciated.

I'm closing this issue because it's not actionable.