SteamWar/FightSystem
Archiviert
13
1

Fixing ConcurrentModificationException

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-09-06 21:34:46 +02:00
Ursprung 859e404536
Commit 38b95a144b

Datei anzeigen

@ -24,7 +24,7 @@ import java.util.List;
public abstract class Recorder { public abstract class Recorder {
private static List<Recorder> recorders = new ArrayList<>(); private static final List<Recorder> recorders = new ArrayList<>();
public static void rBoolean(boolean b){ public static void rBoolean(boolean b){
recorders.forEach((recorder) -> recorder.writeBoolean(b)); recorders.forEach((recorder) -> recorder.writeBoolean(b));
@ -63,7 +63,8 @@ public abstract class Recorder {
} }
public static void closeAll(){ public static void closeAll(){
recorders.forEach(Recorder::close); while(!recorders.isEmpty())
recorders.get(0).close();
} }
protected Recorder(){ protected Recorder(){