Skip to content

Commit

Permalink
fix(VoiceReceiver): fix memory leak (#5609)
Browse files Browse the repository at this point in the history
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
  • Loading branch information
Nojay-Games and vladfrangu committed May 11, 2021
1 parent c56c4a8 commit 2eac842
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/client/voice/receiver/Receiver.js
Expand Up @@ -48,6 +48,7 @@ class VoiceReceiver extends EventEmitter {
const stream = this.packets.makeStream(user.id, end);
if (mode === 'pcm') {
const decoder = new prism.opus.Decoder({ channels: 2, rate: 48000, frameSize: 960 });
decoder.once('close', () => stream.destroy());
stream.pipe(decoder);
return decoder;
}
Expand Down

0 comments on commit 2eac842

Please sign in to comment.