From 793686393414006c98f6a7dd73e5c092f2200362 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 7 Oct 2022 10:07:46 +0200 Subject: [PATCH] remove options on dispose in Member to ensure callback can't be called anymore, as we don't check that the member argument is the one currently in GroupCall._members. --- src/matrix/calls/group/Member.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/matrix/calls/group/Member.ts b/src/matrix/calls/group/Member.ts index 5f6325b5..8763bf5e 100644 --- a/src/matrix/calls/group/Member.ts +++ b/src/matrix/calls/group/Member.ts @@ -98,7 +98,7 @@ export class Member { constructor( public member: RoomMember, private callDeviceMembership: CallDeviceMembership, - private readonly options: Options, + private options: Options, updateMemberLog: ILogItem ) { this._renewExpireTimeout(updateMemberLog); @@ -402,6 +402,8 @@ export class Member { this.connection = undefined; this.expireTimeout?.dispose(); this.expireTimeout = undefined; + // ensure the emitUpdate callback can't be called anymore + this.options = undefined as any as Options; } }