1
mirror of https://github.com/CarmJos/MineSQL.git synced 2026-06-05 00:48:16 +08:00

当命名空间下无注册实例时,删除命名空间

This commit is contained in:
Ghost_chu
2022-01-30 12:33:20 +08:00
parent b09c593bc9
commit 56f01b1cfe
2 changed files with 2 additions and 3 deletions
@@ -112,12 +112,10 @@ public class EasySQLManager implements EasySQLAPI {
@Override
public void unregisterSQLManager(@NotNull String name) {
LOCK.lock();
// 先清除命名空间
this.sqlManagerRegistry.remove(name);
// 再清除名称
for (Map.Entry<String, Set<String>> stringSetEntry : this.nameSpaceRegistry.entrySet()) {
stringSetEntry.getValue().remove(name);
}
this.nameSpaceRegistry.entrySet().removeIf(stringSetEntry -> stringSetEntry.getValue().isEmpty());
LOCK.unlock();
}