1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Properly dispose of CallFeeds

This commit is contained in:
Robert Long
2021-09-09 17:15:41 -07:00
parent 2cdf5629e5
commit 3b4dcbb01d
2 changed files with 11 additions and 1 deletions

View File

@@ -558,6 +558,10 @@ export class MatrixCall extends EventEmitter {
}
private deleteAllFeeds(): void {
for (const feed of this.feeds) {
feed.dispose();
}
this.feeds = [];
this.emit(CallEvent.FeedsChanged, this.feeds);
}
@@ -571,6 +575,7 @@ export class MatrixCall extends EventEmitter {
return;
}
feed.dispose();
this.feeds.splice(this.feeds.indexOf(feed), 1);
this.emit(CallEvent.FeedsChanged, this.feeds);
}