Stream.destroy() doesn't get garbage collected, creates memory leak.
- Dominant language
- JavaScript
- Stars
- 4.7k
- Forks
- 852
- PR merge metrics
- No merged PRs in 30d
Description
Using discord.js voice, latest version. ytdl is also latest.
after destroying the stream, when using chrome devtools, it shows a JsArrayBufferData object (or multiple, not sure) is left behind, even after garbage collecting manually (tested the garbage collector, it does work.)
```
player.audiostream = ytdl(ytlink, {//playerr.audiostream = ytdl(ytlink, {
filter: "audioonly", quality: 'highestaudio', format: 'webm', highWaterMark: 1 << 25, requestOptions: {
headers: {
cookie: COOKIE
}
}
})
let res = createAudioResource(player.audiostream);
player.play(res)
let killstream = function(){ //logs false then true, meaning the stream *should* be destroyed
console.log(this.audiostream.destroyed)
this.audiostream.destroy()
console.log(this.audiostream.destroyed)
}
player.once(AudioPlayerStatus.Idle, killstream)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.