aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
716 stars 472 forks source link

AudioRedWorker guaranteed to leak after terminating a call #2956

Closed issacgerges closed 3 weeks ago

issacgerges commented 2 months ago

What happened and what did you expect to happen?

When terminating a call when audioRed was enabled, the this.audioRedWorker reference is cleaned up, but the worker isn't explicitly terminated. This means the worker will live on for the length of the session, retaining some memory

image

The following should call this.audoRedWorker.terminate() before removing the reference via this.audioRedWorker = null;

https://github.com/aws/amazon-chime-sdk-js/blob/b4e0280f2183c0256c5a1d42a70b4b6c7fcf93e8/src/transceivercontroller/DefaultTransceiverController.ts#L630-L645

Have you reviewed our existing documentation?

Reproduction steps

Create a call with audioRed enabled and end it and see the worker global scopes retained

Amazon Chime SDK for JavaScript version

3.23.0

What browsers are you seeing the problem on?

Chromium

Browser version

128.0.6613.120

Meeting and Attendee ID Information.

No response

Browser console logs

n/a

hensmi-amazon commented 1 month ago

Made change recommended in https://github.com/aws/amazon-chime-sdk-js/pull/2960, thanks!

ltrung commented 3 weeks ago

Fix has been merged. Closing for now.