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 memory leak #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix memory leak #36

wants to merge 1 commit into from

Conversation

lightrabbit
Copy link

@lightrabbit lightrabbit commented Aug 4, 2024

When the parent element and the child element use the same blendFilter, the backdrop in the blendFilter will be overwritten. The overwritten backdrop cannot be recycled by the RenderTexturePool, resulting in leakage.

The following is a simple example that reproduces the problem.

import * as PIXI from 'pixi.js';
import {Sprite, getBlendFilterArray} from '@pixi/picture';
// hacked sprite or tilingSprite
const sprite = new Sprite();
sprite.blendMode = PIXI.BLEND_MODES.OVERLAY;
// container with same filter
const container = new PIXI.Container();
container.filters = getBlendFilterArray(PIXI.BLEND_MODES.OVERLAY);

// add sprite as container's child
container.addChild(sprite);

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