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

DynamicTilemapLayer destroy exception #4634

Closed
CipSoft-Components opened this issue Jul 1, 2019 · 1 comment
Closed

DynamicTilemapLayer destroy exception #4634

CipSoft-Components opened this issue Jul 1, 2019 · 1 comment

Comments

@CipSoft-Components
Copy link

Version

  • Phaser Version: v3.18.1-FB
  • Operating system: Windows 10
  • Browser: Not browser specific

Description

After I fixed the issue #4544 by my self, and remove a scene with a DynamicTilemap, I get the following error:
TypeError: Cannot read property 'tilemapLayer' of undefined
I breaked this down to, that first the DisplayList destroys the DynamicTilemapLayer, and then the UpdateList trys to destroy it. But the DynamicTilemapLayer is not prepared to, that its destroy method is called more than once, and breakes with that error.

Example Test Code

// main game scene
const testmap = this.make.tilemap({ key: 'Testmap' });
testmap.createDynamicLayer('walkable', [testmap.addTilesetImage('tiles', 'tiles')])

// some ui scene, with an exit button, which removes the main game scene
mainScene.scene.remove(); // during this call, the error occures

Additional Information

How I already told, I fixed the issue #4544 by my self, so that the UpdateList really removes its content. By this, it is tried twice to remove the DynamicTilemapLayer.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

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

No branches or pull requests

2 participants