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: recursively dispose of properties #3088

Closed
wants to merge 6 commits into from

Conversation

CodyJasonBennett
Copy link
Member

Follow-up to #3087. Ensures that properties are properly disposed as well.

Copy link

codesandbox-ci bot commented Nov 6, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5a3d453:

Sandbox Source
example Configuration

Comment on lines -179 to +182
for (const p in obj) {
;(p as any).dispose?.()
delete obj[p]
for (const key in obj) {
const value = obj[key]
if (value?.dispose && value.type !== 'Scene') value.dispose?.()
// delete obj[key]
Copy link
Member Author

Choose a reason for hiding this comment

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

This didn't work in the first place @drcmda. p was a key or string type.

@CodyJasonBennett
Copy link
Member Author

Moving this to v9. Will backport if able. Need to do more memory testing.

@CodyJasonBennett CodyJasonBennett deleted the fix/dispose-properties branch April 28, 2024 02:09
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