Skip to content

Commit

Permalink
Update _object_tracker.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Sep 28, 2023
1 parent 9e32356 commit 4dca891
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/leak_tracker/lib/src/leak_tracking/_object_tracker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class ObjectTracker implements LeakProvider {
/// Is used to make sure all disposables are disposed by the the end of the test.
void declareAllNotDisposedAsLeaks() {
throwIfDisposed();
// We need this temporary storage to avoid errror 'concurrent modification during iteration'
// for internal iterables in `_objects.notGCed`.
final notGCedAndNotDisposed = <ObjectRecord>[];
_objects.notGCed.forEach((record) {
if (!record.isDisposed) notGCedAndNotDisposed.add(record);
Expand Down

0 comments on commit 4dca891

Please sign in to comment.