-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when removing multiple CustomDataSources with CallbackProperties #7758
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. |
Any news on this? I was really happy to use the CallbackProperty api since it improves my app's performance significantly. But unfortunately since I have several data sources my app crashes a lot |
Up vote this, since there doesn't appear to be any news. I'm using cesium/resium in react with multiple CzmlDataSource, and it crashes when I go to another page of my app, the app crashes. |
Same here. |
@mramato I know your comment was from 4+ years ago but I've spent some time digging deeper into this issue and hope we can find a solution together. We recently upgraded to version 1.108 and this bug is now causing frequent crashes for us. I've spent some time looking into it and I have some findings to share. Our system creates and renders two Polylines when an object is selected and those Polylines are removed when the object is deselected. While the Polylines are related to the selected object, they are not related to eachother so they are created and managed via distinct CustomDataSource objects. This bug crashes our system every time an object is deselected because of the subsequent removal of the two Polylines. We use Callback properties for the positions of the Polylines because this is the only way to render them without a flicker. For the sake of clarity, I'll refer to Polylines that use Callback properties for the positions as "Callback Polylines" and Polylines that use Constant properties for the positions as "Constant Polylines". As far as I can tell, the following is true:
Consider cases where you have 2 Callback Polylines and 1 Constant Polyline that are all removed in various orders: Case 1. Remove the Constant Polyline first: Crashes when the 3rd polyline is removed The system still crashes even when there is still a Constant Polyline in the collection. However, it will not crash if there's still a Callback Polyline in the system. Consider the same cases shown above except this time with a 4th Polyline: a Callback Polyline that never gets removed. None of these cases cause a crash because the PolylineCollection is presumably never destroyed. Case 1. Remove the Constant Polyline first: No crash Everything seems to indicate the PolylineCollection is being destroyed when the final Callback Polyline is removed from the system. I suspect the crash occurs when that destroyed PolylineCollection is accessed when it should not be. I've tried to identify the problematic code but I'm not very familiar with the internal Cesium code so my efforts have been unsuccessful. Questions:
Please let me know if there's anything else I can do to help find a solution to this bug. |
Unfortunately the only workaround I have found is to force the system to never destroy the PolylineCollection by never allowing it to become empty. This is obviously not desirable but it can help stabilize your app if it is plagued by crashes.
|
I believe this issue and #9154 - Cesium crashes when removing multiple dataSources are caused by the same underlying bug. Upon reading that issue, it sounds like the polylines are the culprit. |
Any updates on this issue? |
Resolved in #11640 |
Remove PolylineCollections from the Scene before they are destroyed. This causes CesiumGS#7758 and CesiumGS#9154.
This reverts commit 2189e16.
Forum link
Sandcastle
Clicking "remove" will throw the following error (I'm showing the unminified error):
This only happens under very specific conditions. It will NOT happen if:
viewer.dataSources.add(dataSource2);
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.
The text was updated successfully, but these errors were encountered: