You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: Handle disposal of message store correctly
This fixes a bug caused by MessageListView instances unregistering themselves
from the collection containing these instances, while we are iterating the exact
same set when disposing the message store.
Part of the work of disposing a MessageListView is to remove it from
a collection of MessageListViews, and we've been doing this in a loop
over the exact same collection (the set MessageStoreImpl._messageListViews).
This has been causing concurrent modification errors.
The errors originated from this requirement of dart Iterable:
> Changing a collection while it is being iterated is generally not allowed
This fix avoids those errors by having the loop iterate over a clone of
that collection instead.
See also: https://api.flutter.dev/flutter/dart-core/Iterable-class.htmlFixes: zulip#810
Signed-off-by: Zixuan James Li <[email protected]>
0 commit comments