An error occurred while rendering. Rendering has stopped.
DeveloperError: This object was destroyed, i.e., destroy() was called.
Error
at new t (http://localhost:81/Build/Cesium/Cesium.js:424:6660)
at A.o (http://localhost:81/Build/Cesium/Cesium.js:428:29924)
at h.update (http://localhost:81/Build/Cesium/Cesium.js:454:5173)
at x.update (http://localhost:81/Build/Cesium/Cesium.js:455:15704)
at Y._onTick (http://localhost:81/Build/Cesium/Cesium.js:477:3362)
at i.raiseEvent (http://localhost:81/Build/Cesium/Cesium.js:424:23947)
at l.tick (http://localhost:81/Build/Cesium/Cesium.js:431:31042)
at A.render (http://localhost:81/Build/Cesium/Cesium.js:474:13132)
at t (http://localhost:81/Build/Cesium/Cesium.js:473:31914)
This happens on creating a new entity and adding to the scene.
I've created a minimal script to repro the problem. Clicking the folllowing button sequence : Entity,Clear,Entity I get the rendering has stopped message.
I'm using Cesium 1.18. Can anyone help me understand the cause of the problem please?
<script id="cesium_sandcastle_script">
var _viewer;
var _entity;
function startup(Cesium) {
"use strict";
_entity = null;
_viewer = new Cesium.Viewer('cesiumContainer',
{
animation: false,
geocoder: false,
timeline: false,
orderIndependentTranslucency: false
});
Sandcastle.addToolbarButton("Entity", onEntityClick);
Sandcastle.addToolbarButton("Clear", onClearClick);
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
function onEntityClick() {
clearEntity();
_entity = _viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(-122.332769, 47.605560),
point: {
pixelSize: 15,
color: Cesium.Color.LIME
}});
}
function onClearClick() {
clearEntity();
_viewer.scene.primitives.removeAll();
}
function clearEntity() {
if( _entity != null) {
_viewer.entities.remove( _entity);
_entity = null;
}
}
</script>