Skip to content

Conversation

@j9liu
Copy link
Contributor

@j9liu j9liu commented Jan 9, 2026

Description

This implementation is inspired by what we do in Cesium for Unity. Instead of calling DestroyTileset immediately in RefreshTileset, this queues the function to happen on the next Tick(). This does not affect object destruction when the Actor itself is destroyed.

Issue number or link

Fixes #1784.

Author checklist

  • I have done a full self-review of my code.
  • I have updated CHANGES.md with a short summary of my change (for user-facing changes).
  • [ ] I have added or updated unit tests to ensure consistent code coverage as necessary.
  • [ ] I have updated the documentation as necessary.

Testing plan

Go through the Reproduction Steps in #1784 and confirm they don't result in a crash.

@j9liu j9liu added this to the February 2026 Release milestone Jan 9, 2026
@j9liu j9liu self-assigned this Jan 9, 2026
@j9liu
Copy link
Contributor Author

j9liu commented Jan 12, 2026

I saw that the height sampling tests were failing, and I don't know if I understand the logistics of how the Tick prevented the test from succeeding. But I saw that RefreshTileset was being invoked during ResolveCreditSystem, so I changed it to a direct DestroyTileset call that mimicked the old behavior.

Before that, I moved the _destroyOnNextTick = false line to the top of DestroyTileset, and that seemed to work too. But it seems better to unset that in the actual Tick function.

@j9liu
Copy link
Contributor Author

j9liu commented Jan 12, 2026

I don't know if I understand the logistics of how the Tick prevented the test from succeeding.

Silly me... it's because DestroyTileset calls the Tileset destructor, which immediately fails all height requests! And although ResolveCreditSystem is called right away in SampleHeightMostDetailed, the RefreshTileset won't be processed until the next Tick as expected.

@j9liu j9liu requested review from azrogers and removed request for azrogers January 13, 2026 19:05
@david-lively david-lively self-requested a review January 15, 2026 16:45
Copy link
Contributor

@david-lively david-lively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@david-lively david-lively merged commit fc8074f into main Jan 15, 2026
23 checks passed
@david-lively david-lively deleted the bad-destroy branch January 15, 2026 16:48
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.

Cesium3DTileset can accidentally delete its Tileset mid-tick

3 participants