Skip to content

fix memory leak#36

Open
lightrabbit wants to merge 1 commit into
pixijs-userland:masterfrom
lightrabbit:master
Open

fix memory leak#36
lightrabbit wants to merge 1 commit into
pixijs-userland:masterfrom
lightrabbit:master

Conversation

@lightrabbit

@lightrabbit lightrabbit commented Aug 4, 2024

Copy link
Copy Markdown

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