Skip to content
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

Fix intermittent geometry entity crash #6577

Merged
merged 2 commits into from
May 9, 2018
Merged

Fix intermittent geometry entity crash #6577

merged 2 commits into from
May 9, 2018

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented May 8, 2018

Fixes #3061

The crash was happening because setting show triggered a subscription that added the updater to an showsUpdated associative array and setting polygon.material removed the polygon from the batch but not from showsUpdated. So when Batch.updateShows is called it iterates through showsUpdated and was crashing because the instance no longer exists for the polygon that was removed.

@cesium-concierge
Copy link

Signed CLA is on file.

@hpinkos, thanks for the pull request! Maintainers, we have a signed CLA from @hpinkos, so you can review this at any time.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@hpinkos
Copy link
Contributor Author

hpinkos commented May 8, 2018

@bflood-agi @nmschulte This should fix the crashes you reported in #3061
This ended up being a pretty easy fix, sorry we weren't able to look into it sooner! Thanks for giving us information for how to reproduce it

@bflood-agi
Copy link
Contributor

Awesome! Thanks @hpinkos!

@hpinkos hpinkos requested a review from mramato May 9, 2018 14:11
@mramato
Copy link
Contributor

mramato commented May 9, 2018

Unfortunately, I can still reproduce the problem in this branch.

@mramato
Copy link
Contributor

mramato commented May 9, 2018

TypeError: Cannot read property 'id' of undefined
    at Batch.updateShows (https://cesiumjs.org/Cesium/Source/DataSources/StaticGeometryColorBatch.js:265:59)
    at Batch.update (https://cesiumjs.org/Cesium/Source/DataSources/StaticGeometryColorBatch.js:249:18)
    at updateItems (https://cesiumjs.org/Cesium/Source/DataSources/StaticGeometryColorBatch.js:427:34)
    at StaticGeometryColorBatch.update (https://cesiumjs.org/Cesium/Source/DataSources/StaticGeometryColorBatch.js:434:25)
    at GeometryVisualizer.update (https://cesiumjs.org/Cesium/Source/DataSources/GeometryVisualizer.js:253:36)
    at DataSourceDisplay.update (https://cesiumjs.org/Cesium/Source/DataSources/DataSourceDisplay.js:272:37)
    at Viewer._onTick (https://cesiumjs.org/Cesium/Source/Widgets/Viewer/Viewer.js:1569:49)
    at Event.raiseEvent (https://cesiumjs.org/Cesium/Source/Core/Event.js:146:30)
    at Clock.tick (https://cesiumjs.org/Cesium/Source/Core/Clock.js:307:21)
    at CesiumWidget.render (https://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:693:43)

@hpinkos
Copy link
Contributor Author

hpinkos commented May 9, 2018

Dangit, really? I ran the thing forever and it didn't crash.

Do you think I can just add a if (!defined(instance)) { return } in updateShows?

@mramato
Copy link
Contributor

mramato commented May 9, 2018

Wait, hold on. I think I screwed up.

@mramato
Copy link
Contributor

mramato commented May 9, 2018

Sorry for the scare, I was actually running in the wrong tab and using cesiumjs.org instead of my local build 😄

@mramato
Copy link
Contributor

mramato commented May 9, 2018

Yep, this is definitely fixed. I'll merge when green.

@hpinkos
Copy link
Contributor Author

hpinkos commented May 9, 2018

🎉

@mramato mramato merged commit c76001e into master May 9, 2018
@mramato mramato deleted the fix-3061 branch May 9, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants