null out micSource and micMedia to make the GC happier

This commit is contained in:
Marks Polakovs 2020-05-10 17:31:22 +02:00
parent 29a0971d57
commit c4990f9f66

View file

@ -270,6 +270,8 @@ export class AudioEngine extends ((EngineEmitter as unknown) as {
if (this.micSource !== null && this.micMedia !== null) {
this.micMedia.getAudioTracks()[0].stop();
this.micSource.disconnect();
this.micSource = null;
this.micMedia = null;
}
console.log("opening mic", deviceId);
this.micMedia = await navigator.mediaDevices.getUserMedia({