mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 00:27:58 +00:00
parent
0e94a0f046
commit
d601b4be3a
1 changed files with 8 additions and 0 deletions
|
@ -317,6 +317,14 @@ Tone.BufferSource.prototype._onended = function(){
|
|||
this._source.stop(this._stopTime + additionalTail);
|
||||
}
|
||||
this.onended(this);
|
||||
|
||||
//dispose the source after it's come to a stop
|
||||
setTimeout(function(){
|
||||
//if it hasn't already been disposed
|
||||
if (this._source){
|
||||
this.dispose();
|
||||
}
|
||||
}.bind(this), additionalTail * 1000 + 100);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue