Skip to content

Crash when calling destroy() on Sequence  #34

@andreasmpet

Description

@andreasmpet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions