Cesium crashes when switching SceneMode's multiple times

I tried implementing my own SceneMode picker and got Cesium to crash when I was testing it. To my surprise this crash is easily reproducible with any basic example in sandcastle.

Steps to reproduce :

  1. Open sandcastle on any example

  2. Switch from 3D to 2D

  3. Switch to Columbus

  4. Swtich to 2D

  5. Repeat 3 and 4 until crash.

The result is either the crash in the attached screenshot (when the scene has objects), or when there are no objects the whole tab crashes.

Another thing I’ve noticed is that when switching the third time to columbus view, the scene seems to be much slower

Thanks for the well written report. We have an existing issue on the problem which you can keep an eye on: https://github.com/AnalyticalGraphicsInc/cesium/issues/1518. I also updated it with a link to your post so we’ll remember to update this thread when we have a fix. I think the problem is related to overlapping morphs or the speed at which morphs happens, causing race conditions; but I’m not 100% sure. Might be a good bug to look into during our upcoming code sprint.

Thanks again.