[Gltf]: An error will raise when a model is unavailable

Hi, All,
I create a czml has two models. One will live longer than another. When the shorter life model was unavailable an error will raise. It said,

An error occurred while rendering. Rendering has stopped.

DeveloperError: This object was destroyed, i.e., destroy() was called.

Error

at new DeveloperError (http://192.168.1.100:8080/Source/Core/DeveloperError.js:37:17)

at throwOnDestroyed (http://192.168.1.100:8080/Source/Core/destroyObject.js:44:19)

at CompositePrimitive.update (http://192.168.1.100:8080/Source/Scene/CompositePrimitive.js:410:27)

at updatePrimitives (http://192.168.1.100:8080/Source/Scene/Scene.js:828:27)

at Scene.render (http://192.168.1.100:8080/Source/Scene/Scene.js:886:9)

at CesiumWidget.render (http://192.168.1.100:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:537:25)

at Viewer.render (http://192.168.1.100:8080/Source/Widgets/Viewer/Viewer.js:701:28)

at render (http://192.168.1.100:8080/Source/Widgets/Viewer/Viewer.js:69:28)

I debugged Cesium. I found in render loop the model object still referenced in primitives array, even it’s already unavailable.

Attachment is my test czml.

battlefield.czml (329 KB)

This file didn’t crash for me, but models didn’t load either. You need to swap your “gltf” and “uri” properties in your CZML in order to make it work in master, once you do that, everything works fine.

Hi, Matthew,
Thank you! My Czml is working on master branch.

-Shawn