Cesium: Crash when removing multiple CustomDataSources with CallbackProperties

Created on 18 Apr 2019  路  4Comments  路  Source: CesiumGS/cesium

Forum link

Sandcastle

Clicking "remove" will throw the following error (I'm showing the unminified error):

DeveloperError: This object was destroyed, i.e., destroy() was called.
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:43:19)
    at PolylineCollection.throwOnDestroyed (http://localhost:8080/Source/Core/destroyObject.js:45:19)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:369:27)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:369:27)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:369:27)
    at updateAndRenderPrimitives (http://localhost:8080/Source/Scene/Scene.js:2937:27)
    at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2776:13)
    at updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:2584:13)
    at render (http://localhost:8080/Source/Scene/Scene.js:3224:9)
    at tryAndCatchError (http://localhost:8080/Source/Scene/Scene.js:3244:13)

This only happens under very specific conditions. It will NOT happen if:

  • You comment out one of the datasources.add lines like viewer.dataSources.add(dataSource2);
  • If only one of the entities has a callback property (try uncommenting the positions line positions : Cesium.Cartesian3.fromDegreesArray(poss1))

It also works fine if you remove the entities directly from each dataSource, as opposed to removing the dataSource itself.

There aren't any Sandcastle examples using CustomDataSource to group entities this way, so I'm not sure if this is expected. My workaround is to just store the entities yourself in an array and handle iterating through and removing when you need to remove a group.

category - data sources type - bug

Most helpful comment

hello, team. I'm having this same issue and wanted to check on the status of the bug fix. Are there any other identified workarounds at this time?

I'm using Resium in a React project, and whenever I have more than one CustomDataSource that includes a PolylineGraphics Entity that is using a CallbackProperty I will receive this same error when navigating to another page within the application. Removing the CallbackProperty, the PolylineGraphics Entity, or the additional CustomDataSources resolves the issue.

All 4 comments

At first glance, this looks like a clear cut bug on our end. Should be easy to figure out with the reduced test case. Thanks!

hello, team. I'm having this same issue and wanted to check on the status of the bug fix. Are there any other identified workarounds at this time?

I'm using Resium in a React project, and whenever I have more than one CustomDataSource that includes a PolylineGraphics Entity that is using a CallbackProperty I will receive this same error when navigating to another page within the application. Removing the CallbackProperty, the PolylineGraphics Entity, or the additional CustomDataSources resolves the issue.

Any update on this? I've reported the issue before that datasources can not be consecutively removed without an error being trigged.

Having the same problem working with resium. when i move out of the component i get this error that crashes my whole app.
i try to destroy the modelRef in the useEffect but that doesnt happen.
Any updates on this bug?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcenirm picture mcenirm  路  4Comments

OmarShehata picture OmarShehata  路  4Comments

thw0rted picture thw0rted  路  4Comments

JacksonBates picture JacksonBates  路  3Comments

OmarShehata picture OmarShehata  路  4Comments