diff --git a/README.md b/README.md index 3863ed26e..333a3d58a 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/ * The `mouseoutglobal` event listener wasn't removed when the game was destroyed (thanks @stoneman1 #2345 #2344 #2342) * Fixed issue with IE crashing on this.context.close in the Sound Manager (thanks @stoneman1 #2349) * Phaser.World.centerX and Phaser.World.centerY only worked if the bounds had an origin of 0, 0. They now take into account the actual origin (thanks @fillmoreb #2353) +* SoundManager.close now validates that context.close is a valid function before calling it (thanks @brianbunch #2355) ### Pixi Updates diff --git a/src/sound/SoundManager.js b/src/sound/SoundManager.js index c9be5a3ad..f1ae00f48 100644 --- a/src/sound/SoundManager.js +++ b/src/sound/SoundManager.js @@ -729,11 +729,12 @@ Phaser.SoundManager.prototype = { this._sounds = []; this.onSoundDecode.dispose(); - if (this.context) { + + if (this.context && this.context.close) + { this.context.close(); } - if (this.context && window['PhaserGlobal']) { // Store this in the PhaserGlobal window var, if set, to allow for re-use if the game is created again without the page refreshing