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

Null a potentially dangling screen entity reference on remove #2524

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

yaustar
Copy link
Contributor

@yaustar yaustar commented Nov 3, 2020

Fixes an edge case where a user may remove an element entity when the screen entity is being destroyed by nulling a potentially dangling reference to the screen entity.

Repo: https://playcanvas.com/editor/scene/1023656 (press 1)

The existing code assumed (as an optimisation) that if the screen entity is being destroyed, then there is no need to call _updateScreen as it is going to get destroyed too.

I do feel like the edge case will have problems as it relies on the order of operations of entities being destroyed that are internal to the engine and that child elements should be removed before the parent is destroyed.

I confirm I have signed the Contributor License Agreement.

@yaustar yaustar added bug area: ui UI related issue labels Nov 3, 2020
@yaustar yaustar requested a review from a team November 3, 2020 11:53
@yaustar yaustar self-assigned this Nov 3, 2020
@willeastcott willeastcott requested review from vkalpias and removed request for a team November 5, 2020 10:11
@yaustar yaustar merged commit 2efe005 into master Nov 5, 2020
@yaustar yaustar deleted the fix-unbind-screen-null-exception branch November 5, 2020 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui UI related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants