fix possible races

This commit is contained in:
zelva 2022-09-02 21:04:15 +03:00 committed by TobiGr
parent 360b411503
commit 6456e0c3f2
1 changed files with 2 additions and 2 deletions

View File

@ -233,8 +233,8 @@ public abstract class PlayQueue implements Serializable {
* @return an immutable view of the play queue
*/
@NonNull
public synchronized List<PlayQueueItem> getStreams() { // todo: iterator race
return Collections.unmodifiableList(streams);
public synchronized List<PlayQueueItem> getStreams() {
return Collections.unmodifiableList(new ArrayList<>(streams));
}
/*//////////////////////////////////////////////////////////////////////////