Sprite destroy()

Hi all.
How i can erase sprite from memory?

const gameObject = this.add.sprite(0, 0, key, frame);

When i use gameObject.destroy() it removes from render. But it still in updateList => in memory.


If the sprite is still on the update list after this, that may be a Phaser bug. But I think the bug happens only if you destroy it immediately after creating it, which is unusual.

In JS you can’t really remove anything from memory directly. You just remove references, and when all references are gone the browser will eventually clean up.