Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when calling destroy() on Sequence #34

Open
andreasmpet opened this issue May 19, 2022 · 0 comments
Open

Crash when calling destroy() on Sequence #34

andreasmpet opened this issue May 19, 2022 · 0 comments

Comments

@andreasmpet
Copy link

Hi!

I noticed that in Sequence's destroy() method you're iterating through a collection with forEach at the same time as you're modifying it. Not sure how this has worked before. Maybe some behavior of how iterating through the values of a map has changed recently.

void destroy() {
    _tracks.values.forEach((track) => deleteTrack(track));
    globalState.unregisterSequence(this);
}

deleteTrack now seems to be modifying the collection we are iterating through it.
A simple solution is to copy the list of track to a list before iterating through it, or just using _tracks.values.toList().forEach instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant