Hi,
i’m getting some strange errors sometimes if i shutdown my scene after game finished…
TypeError: Cannot read property 'destroy' of undefined
It is thrown at line 41176 of the “phaser.min.js” (on pretty print)
shutdown: function() {
for (var t = this.list, e = t.length; e--; )
t[e].destroy(!0);
t.length = 0,
this.events.off(a.SHUTDOWN, this.shutdown, this)
},
While debugging this, i see:
“this.list” has a length of 47, “e” is set to “47” and inside the for-loop it must crash each time because u cant access a item in array out of range
e should be 46 inside loop, but it isnt…
what am i doing wrong?
Why i get this error sometimes, sometimes not…
I have many objects in my game that are spawned randomly and also have a lifespan and getting destroyed after some times… So. Maybe the “shutdown” is colliding with this “lifespan” destroys?