From 825602a04a2d89dd6cb7ec75cab3de821a6b77fc Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 27 Jan 2023 10:12:36 +0100 Subject: [PATCH] dispose local media here when returning early as join takes ownership --- src/matrix/calls/group/GroupCall.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/matrix/calls/group/GroupCall.ts b/src/matrix/calls/group/GroupCall.ts index 9ef2e068..0460c212 100644 --- a/src/matrix/calls/group/GroupCall.ts +++ b/src/matrix/calls/group/GroupCall.ts @@ -191,6 +191,7 @@ export class GroupCall extends EventEmitter<{change: never}> { join(localMedia: LocalMedia, log?: ILogItem): Promise { return this.options.logger.wrapOrRun(log, "Call.join", async joinLog => { if (this._state !== GroupCallState.Created || this.joinedData || this.usesFoci) { + localMedia.dispose(); return; } const logItem = this.options.logger.child({