Skip to content

Commit 37f75fd

Browse files
authored
Merge pull request phaserjs#3675 from tjb295/master
Bug: phaserjs#3645 issue with clearing GameObjects from this._list. Called qu…
2 parents fdf7fb1 + ac19b1b commit 37f75fd

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/input/InputPlugin.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ var InputPlugin = new Class({
367367

368368
// Clear the removal list
369369
removeList.length = 0;
370+
this._pendingRemoval.length = 0;
370371

371372
// Move pendingInsertion to list (also clears pendingInsertion at the same time)
372373
this._list = current.concat(insertList.splice(0));
@@ -386,6 +387,13 @@ var InputPlugin = new Class({
386387
{
387388
var input = gameObject.input;
388389

390+
// If GameObject.input already cleared from higher class
391+
if(!input)
392+
{
393+
return;
394+
}
395+
396+
this.queueForRemoval(gameObject);
389397
input.gameObject = undefined;
390398
input.target = undefined;
391399
input.hitArea = undefined;
@@ -1639,7 +1647,7 @@ var InputPlugin = new Class({
16391647
},
16401648

16411649
/**
1642-
* The Scene that owns this plugin is being destroyed.
1650+
* The Scene that owns this plugin is being destroyed.
16431651
* We need to shutdown and then kill off all external references.
16441652
*
16451653
* @method Phaser.Input.InputPlugin#destroy

0 commit comments

Comments
 (0)