Implemented destroy method for WebAudioSoundManager class

This commit is contained in:
Pavle Goloskokovic 2018-01-07 20:20:01 +01:00
parent 9b0ed25a4d
commit 69b3348aca

View file

@ -113,6 +113,16 @@ var WebAudioSoundManager = new Class({
*/ */
onFocus: function () { onFocus: function () {
this.context.resume(); this.context.resume();
},
destroy: function () {
BaseSoundManager.prototype.destroy.call(this);
this.destination = null;
this.masterVolumeNode.disconnect();
this.masterVolumeNode = null;
this.masterMuteNode.disconnect();
this.masterMuteNode = null;
this.context.suspend();
this.context = null;
} }
}); });
/** /**