Skip to content

Commit

Permalink
Fix #6972. Setting game objects ignoreDestroy to true no longer c…
Browse files Browse the repository at this point in the history
…auses infinite loop bug when `shutdown` is called.
  • Loading branch information
zekeatchan committed Jan 9, 2025
1 parent aafa43a commit 649e217
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gameobjects/DisplayList.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,15 @@ var DisplayList = new Class({
shutdown: function ()
{
var list = this.list;
var i = list.length;

while (list.length)
while (i--)
{
list[0].destroy(true);
list[i].destroy(true);
}

list.length = 0;

this.events.off(SceneEvents.SHUTDOWN, this.shutdown, this);
},

Expand Down

0 comments on commit 649e217

Please sign in to comment.