geforkt von Mirrors/Velocity
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
|
@Override
|
||||||
public void unregister(final String alias) {
|
public void unregister(final String alias) {
|
||||||
Preconditions.checkNotNull(alias, "alias");
|
Preconditions.checkNotNull(alias, "alias");
|
||||||
// The literals of secondary aliases will preserve the children of
|
lock.writeLock().lock();
|
||||||
// the removed literal in the graph.
|
try {
|
||||||
dispatcher.getRoot().removeChildByName(alias.toLowerCase(Locale.ENGLISH));
|
// 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