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: destroy renderGroups #10566

Merged
merged 3 commits into from
May 23, 2024
Merged

fix: destroy renderGroups #10566

merged 3 commits into from
May 23, 2024

Conversation

GoodBoyDigital
Copy link
Member

@GoodBoyDigital GoodBoyDigital commented May 21, 2024

Description of change

Added a destroy function to renderGroup and also made sure it is called when the container that owns it is destroyed.

Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

fixes #10533

Copy link

codesandbox-ci bot commented May 21, 2024

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 b6dccd8:

Sandbox Source
pixi.js-sandbox Configuration

src/scene/container/Container.ts Outdated Show resolved Hide resolved
Comment on lines +227 to +230
(this.childrenRenderablesToUpdate as any) = null;
(this.childrenToUpdate as any) = null;
(this.renderGroupChildren as any) = null;
(this._onRenderContainers as any) = null;
Copy link
Member

Choose a reason for hiding this comment

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

Take this or leave it, but I think this will avoid the as any casting.

Suggested change
(this.childrenRenderablesToUpdate as any) = null;
(this.childrenToUpdate as any) = null;
(this.renderGroupChildren as any) = null;
(this._onRenderContainers as any) = null;
Object.assign(this, {
childrenRenderablesToUpdate: null,
childrenToUpdate: null,
renderGroupChildren: null,
_onRenderContainers: null,
});

Co-authored-by: Matt Karl <matt@mattkarl.com>
@Zyie Zyie added the v8 label May 22, 2024
@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label May 23, 2024
@Zyie Zyie added this pull request to the merge queue May 23, 2024
Merged via the queue into dev with commit e2cb253 May 23, 2024
5 checks passed
@Zyie Zyie deleted the fix/rendergroup-destroy branch May 23, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t v8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Memory Leak / Inappropriate cleanUp - stage.renderGroup cleanUp is not there
3 participants