Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VoiceReceiver): fix memory leak #5609

Merged
merged 2 commits into from
May 11, 2021
Merged

fix(VoiceReceiver): fix memory leak #5609

merged 2 commits into from
May 11, 2021

Conversation

Nojay-Games
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
When you destroy the opus decoder stream that createStream returns when you set mode: 'pcm', the internal stream doesn't get closed and keeps building up data. This is most apparent when setting end: 'manual'. This PR makes sure to close stream when decoder is destroyed.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Fix a memory leak caused by the stream not ending when the opus decoder stream is destroyed.
src/client/voice/receiver/Receiver.js Outdated Show resolved Hide resolved
Co-authored-by: Vlad Frangu <[email protected]>
@amishshah amishshah requested a review from vladfrangu May 11, 2021 06:28
@kyranet kyranet requested review from iCrawl and SpaceEEC May 11, 2021 07:30
@iCrawl iCrawl merged commit 2eac842 into discordjs:master May 11, 2021
@Nojay-Games Nojay-Games deleted the patch-1 branch May 11, 2021 11:38
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants