hotfix: disconnect chain after use
This commit is contained in:
parent
a11d23ba62
commit
3fdfd12448
1 changed files with 4 additions and 0 deletions
|
|
@ -304,6 +304,10 @@ Pattern.prototype.out = function () {
|
||||||
chain.push(ac.destination);
|
chain.push(ac.destination);
|
||||||
// connect chain elements together
|
// connect chain elements together
|
||||||
chain.slice(1).reduce((last, current) => last.connect(current), chain[0]);
|
chain.slice(1).reduce((last, current) => last.connect(current), chain[0]);
|
||||||
|
// disconnect all nodes when hap is over to make sure they are garbage collected
|
||||||
|
setTimeout(() => {
|
||||||
|
chain.forEach((n) => n.disconnect());
|
||||||
|
}, (hapDuration + release + 0.1) * 1000);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('.out error:', e);
|
console.warn('.out error:', e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue