Skip to content
Permalink
Browse files

Fix an infinite loop issue on server shutdown

Related to GH-215
  • Loading branch information...
chickeneer committed Jun 17, 2019
1 parent b175f09 commit 625171b206f30d27e8e9c0d6ebff25102dbc285c
Showing with 3 additions and 2 deletions.
  1. +3 −2 bukkit/src/main/java/co/aikar/commands/BukkitCommandManager.java
@@ -52,6 +52,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -275,8 +276,8 @@ public void unregisterCommand(BukkitRootCommand command) {
}

public void unregisterCommands() {
while (!registeredCommands.isEmpty()) {
unregisterCommand(registeredCommands.values().toArray(new BukkitRootCommand[]{})[0]);
for (String key : new HashSet<>(registeredCommands.keySet())) {
unregisterCommand(registeredCommands.get(key));
}
}

0 comments on commit 625171b

Please sign in to comment.
You can’t perform that action at this time.