Skip to content

Commit fcb05a4

Browse files
gnpricechrisbobbe
authored andcommitted
store: Implement PerAccountStore.dispose
1 parent 9eafed4 commit fcb05a4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/model/store.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ class PerAccountStore extends ChangeNotifier with StreamStore {
241241

242242
// TODO lots more data. When adding, be sure to update handleEvent too.
243243

244-
// TODO call [RecentDmConversationsView.dispose] in [dispose]
245244
final RecentDmConversationsView recentDmConversationsView;
246245

247246
final Set<MessageListView> _messageListViews = {};
@@ -269,6 +268,16 @@ class PerAccountStore extends ChangeNotifier with StreamStore {
269268
autocompleteViewManager.reassemble();
270269
}
271270

271+
@override
272+
void dispose() {
273+
unreads.dispose();
274+
recentDmConversationsView.dispose();
275+
for (final view in _messageListViews.toList()) {
276+
view.dispose();
277+
}
278+
super.dispose();
279+
}
280+
272281
void handleEvent(Event event) {
273282
if (event is HeartbeatEvent) {
274283
assert(debugLog("server event: heartbeat"));

0 commit comments

Comments
 (0)