Destroy old CommunityFilterConditions when they aren't needed

Fixes https://github.com/vector-im/riot-web/issues/13971
pull/21833/head
Travis Ralston 2020-06-09 15:22:37 -06:00
parent 7549d7d98a
commit db23aaad83
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,11 @@ export class TagWatcher {
this.store.removeFilter(filter); 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; this.filters = newFilters;
} }
}; };