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

Concurrent modification when iterating over game spaces during scheduled stop to close them #101

Open
haykam821 opened this issue Jun 9, 2022 · 0 comments

Comments

@haykam821
Copy link
Contributor

haykam821 commented Jun 9, 2022

Nucleoid Extras iterates over every open game space in the game space manager to close them:

for (var gameSpace : 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.

@haykam821 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
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