don't crash if user deny's microphone stream

This commit is contained in:
Luke Phillips 2014-12-16 17:55:08 +00:00
parent 3d8180244f
commit e6caa81479

View file

@ -90,8 +90,9 @@ define(["Tone/core/Tone", "Tone/source/Source"], function(Tone){
*/
Tone.Microphone.prototype.dispose = function() {
Tone.Source.prototype.dispose.call(this);
//this._stream.disconnect();
this._mediaStream.disconnect();
if (this._mediaStream) {
this._mediaStream.disconnect();
}
this._stream = null;
this._mediaStream = null;
};