From 2c8097f130ba708816c4f08a320f7abeec4a26a3 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Mon, 8 Jan 2018 17:31:53 +0100 Subject: [PATCH] Clearing all events listeners if error occurs --- v3/src/loader/filetypes/HTML5AudioFile.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v3/src/loader/filetypes/HTML5AudioFile.js b/v3/src/loader/filetypes/HTML5AudioFile.js index 22a73d769..d4764fb3b 100644 --- a/v3/src/loader/filetypes/HTML5AudioFile.js +++ b/v3/src/loader/filetypes/HTML5AudioFile.js @@ -32,6 +32,13 @@ var HTML5AudioFile = new Class({ onError: function (event) { + for (var i = 0; i < this.data.length; i++) + { + var audio = this.data[i]; + audio.oncanplaythrough = null; + audio.onerror = null; + } + this.callback(this, false); },