dispose local media here when returning early as join takes ownership

This commit is contained in:
Bruno Windels 2023-01-27 10:12:36 +01:00
parent c8bb5fffb0
commit 825602a04a

View File

@ -191,6 +191,7 @@ export class GroupCall extends EventEmitter<{change: never}> {
join(localMedia: LocalMedia, log?: ILogItem): Promise<void> { join(localMedia: LocalMedia, log?: ILogItem): Promise<void> {
return this.options.logger.wrapOrRun(log, "Call.join", async joinLog => { return this.options.logger.wrapOrRun(log, "Call.join", async joinLog => {
if (this._state !== GroupCallState.Created || this.joinedData || this.usesFoci) { if (this._state !== GroupCallState.Created || this.joinedData || this.usesFoci) {
localMedia.dispose();
return; return;
} }
const logItem = this.options.logger.child({ const logItem = this.options.logger.child({