Skip to content

Blitter doesn't destroy its Bobs #7292

Closed

Description

@samme

Version

  • Phaser Version: 4.1.0

Description

Destroying a Blitter empties it of Bobs but doesn't destroy them.

Example Test Code

const blitter = this.add.blitter(0, 0, '__WHITE');

blitter.create(0, 0);
blitter.create(1, 0);
blitter.create(2, 0);

const bobs = blitter.children.list.slice();

console.info('After blitter.create() x3');

console.assert(blitter.children.list.length === 3, 'blitter should have 3 bobs');

for (const bob of bobs)
{
    console.assert(bob.data !== undefined, 'bob.data should not be undefined');
    console.assert(bob.frame !== undefined, 'bob.frame should not be undefined');
    console.assert(bob.parent !== undefined, 'bob.parent should not be undefined');
}

blitter.destroy();

console.info('After blitter.destroy()');

console.assert(blitter.children.list.length === 0, 'children.list should be empty');
console.assert(blitter.children.parent === null, 'children.parent should be null');

for (const bob of bobs)
{
    console.assert(bob.data === undefined, 'bob.data should be undefined');
    console.assert(bob.frame === undefined, 'bob.frame should be undefined');
    console.assert(bob.parent === undefined, 'bob.parent should be undefined');
}

console.info('Done!');

Activity

  1. added a commit that references this issue on Jun 19, 2026
    f5be931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions