Skip to content

Blitter doesn't destroy its Bobs #7292

@samme

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!');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions