From 8ef403cfe795ca7c32b3ecf257a42caad53b7080 Mon Sep 17 00:00:00 2001 From: Georgios Kaleadis Date: Thu, 6 Feb 2014 17:28:39 +0100 Subject: [PATCH] Timer checks now for running inside while loop. Any event which causes a call to Timer#stop is now safe. --- src/time/Timer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time/Timer.js b/src/time/Timer.js index 410c41bf8..e41acc618 100644 --- a/src/time/Timer.js +++ b/src/time/Timer.js @@ -327,7 +327,7 @@ Phaser.Timer.prototype = { { this._i = 0; - while (this._i < this._len) + while (this._i < this._len && this.running) { if (this._now >= this.events[this._i].tick) {