mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-02-06 04:05:28 +01:00
Only lock wen copying
This commit is contained in:
parent
74423d6dc0
commit
8e8b0ca6fc
@ -340,18 +340,20 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void unregisterAll() {
|
private void unregisterAll() {
|
||||||
|
Collection<PlaceholderExpansion> expansionsCopy;
|
||||||
expansionsLock.lock();
|
expansionsLock.lock();
|
||||||
try {
|
try {
|
||||||
for (final PlaceholderExpansion expansion : Sets.newHashSet(expansions.values())) {
|
expansionsCopy = Sets.newHashSet(expansions.values());
|
||||||
if (expansion.persist()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
expansion.unregister();
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
expansionsLock.unlock();
|
expansionsLock.unlock();
|
||||||
}
|
}
|
||||||
|
for (final PlaceholderExpansion expansion : expansionsCopy) {
|
||||||
|
if (expansion.persist()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
expansion.unregister();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
Loading…
Reference in New Issue
Block a user