Skip to content

Commit 62f0a52

Browse files
committed
Fixed issue with IE crashing on this.context.close() in SoundManager.js (There was no check if context exists)
1 parent 4d587d3 commit 62f0a52

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/sound/SoundManager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Phaser.SoundManager.prototype = {
260260
/**
261261
* Sets the Input Manager touch callback to be SoundManager.unlock.
262262
* Required for iOS audio device unlocking. Mostly just used internally.
263-
*
263+
*
264264
* @method Phaser.SoundManager#setTouchLock
265265
*/
266266
setTouchLock: function () {
@@ -285,7 +285,7 @@ Phaser.SoundManager.prototype = {
285285

286286
/**
287287
* Enables the audio, usually after the first touch.
288-
*
288+
*
289289
* @method Phaser.SoundManager#unlock
290290
* @return {boolean} True if the callback should be removed, otherwise false.
291291
*/
@@ -729,8 +729,10 @@ Phaser.SoundManager.prototype = {
729729
this._sounds = [];
730730

731731
this.onSoundDecode.dispose();
732+
if (this.context) {
733+
this.context.close();
734+
}
732735

733-
this.context.close();
734736

735737
if (this.context && window['PhaserGlobal'])
736738
{

0 commit comments

Comments
 (0)