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 #17890: preview scene in editor should also destroy object at the end of the frame rendering #18157

Open
wants to merge 1 commit into
base: v3.8.6
Choose a base branch
from

Conversation

minggo
Copy link
Contributor

@minggo minggo commented Jan 10, 2025

#17890

As the modification shows, setTimeout(CCObject._deferredDestroy); may destroy object at any time. It doesn't promise to destroy objects at the end of the frame. Then other engine components may refer the an invalid object. Which is problem.

preview scene in editor will trigger the issue. So just destroy objects immediately only in editor mode. Editor doesn't use requestAnimationFrame to drive engine loop, it control the loop itself.

…same, or engine components may refer invalid nodes
@minggo minggo requested a review from dumganhar January 10, 2025 10:15
Copy link

✅ Package size is not changed

Interface Check Report

This pull request does not change any public interfaces !

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.

1 participant