From c4990f9f6655d6049c8c3df354fc0f6dc065dc57 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Sun, 10 May 2020 17:31:22 +0200 Subject: [PATCH] null out micSource and micMedia to make the GC happier --- src/mixer/audio.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mixer/audio.ts b/src/mixer/audio.ts index 138e3fd..6c68743 100644 --- a/src/mixer/audio.ts +++ b/src/mixer/audio.ts @@ -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({