Skip to content

Commit cc3a07b

Browse files
committed
SoundManager.close now validates that context.close is a valid function before calling it (thanks @brianbunch phaserjs#2355)
1 parent c04a2be commit cc3a07b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
331331
* The `mouseoutglobal` event listener wasn't removed when the game was destroyed (thanks @stoneman1 #2345 #2344 #2342)
332332
* Fixed issue with IE crashing on this.context.close in the Sound Manager (thanks @stoneman1 #2349)
333333
* 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)
334+
* SoundManager.close now validates that context.close is a valid function before calling it (thanks @brianbunch #2355)
334335

335336
### Pixi Updates
336337

src/sound/SoundManager.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,12 @@ Phaser.SoundManager.prototype = {
729729
this._sounds = [];
730730

731731
this.onSoundDecode.dispose();
732-
if (this.context) {
732+
733+
if (this.context && this.context.close)
734+
{
733735
this.context.close();
734736
}
735737

736-
737738
if (this.context && window['PhaserGlobal'])
738739
{
739740
// Store this in the PhaserGlobal window var, if set, to allow for re-use if the game is created again without the page refreshing

0 commit comments

Comments
 (0)