You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (vargameSpace : GameSpaceManager.get().getOpenGameSpaces()) {
gameSpace.close(GameCloseReason.CANCELED);
}
However, closing a game space removes it from the same list in the game space manager that is being iterated over.
Using the GameSpaceManager.startClosing method, which calls GameSpaceManager#close internally, would solve this issue as its implementation of this behavior copies the list before iterating over the game spaces.
The text was updated successfully, but these errors were encountered:
haykam821
changed the title
Concurrent modification when iterating over game spaces during schedule stop to close them
Concurrent modification when iterating over game spaces during scheduled stop to close them
Aug 7, 2022
Nucleoid Extras iterates over every open game space in the game space manager to close them:
nucleoid-extras/src/main/java/xyz/nucleoid/extras/scheduled_stop/ScheduledStop.java
Lines 83 to 85 in 2b74876
However, closing a game space removes it from the same list in the game space manager that is being iterated over.
Using the
GameSpaceManager.startClosing
method, which callsGameSpaceManager#close
internally, would solve this issue as its implementation of this behavior copies the list before iterating over the game spaces.The text was updated successfully, but these errors were encountered: