Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 15:50:19 +01:00
Fix thread-unsafe command unregistration (#583)
Access to the dispatcher is guarded by `lock`.
Dieser Commit ist enthalten in:
Ursprung
aa210b3544
Commit
567582b2e2
@ -143,9 +143,14 @@ public class VelocityCommandManager implements CommandManager {
|
||||
@Override
|
||||
public void unregister(final String alias) {
|
||||
Preconditions.checkNotNull(alias, "alias");
|
||||
// The literals of secondary aliases will preserve the children of
|
||||
// the removed literal in the graph.
|
||||
dispatcher.getRoot().removeChildByName(alias.toLowerCase(Locale.ENGLISH));
|
||||
lock.writeLock().lock();
|
||||
try {
|
||||
// The literals of secondary aliases will preserve the children of
|
||||
// the removed literal in the graph.
|
||||
dispatcher.getRoot().removeChildByName(alias.toLowerCase(Locale.ENGLISH));
|
||||
} finally {
|
||||
lock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren