diff --git a/src/stores/room-list/TagWatcher.ts b/src/stores/room-list/TagWatcher.ts index 1fb5223e00..22302b695d 100644 --- a/src/stores/room-list/TagWatcher.ts +++ b/src/stores/room-list/TagWatcher.ts @@ -74,6 +74,11 @@ export class TagWatcher { this.store.removeFilter(filter); } + // Destroy any and all old filter conditions to prevent resource leaks + for (const filter of this.filters.values()) { + filter.destroy(); + } + this.filters = newFilters; } };