Skip to content

Commit c37a363

Browse files
committed
UpdateList.shutdown wasn't removing the Scene Update event listener, causing actions to be multiplied on Scene restart (such as animation playback). Fix phaserjs#4799
1 parent c073b06 commit c37a363

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/gameobjects/UpdateList.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ var UpdateList = new Class({
191191
this._active = [];
192192
this._destroy = [];
193193

194+
this.removeAllListeners();
195+
194196
var eventEmitter = this.systems.events;
195197

196198
eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this);
197-
eventEmitter.off(SceneEvents.UPDATE, this.update, this);
199+
eventEmitter.off(SceneEvents.UPDATE, this.sceneUpdate, this);
198200
eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this);
199201
},
200202

@@ -210,7 +212,7 @@ var UpdateList = new Class({
210212
{
211213
this.shutdown();
212214

213-
this.scene.sys.events.off(SceneEvents.START, this.start, this);
215+
this.systems.events.off(SceneEvents.START, this.start, this);
214216

215217
this.scene = null;
216218
this.systems = null;

0 commit comments

Comments
 (0)