1
mirror of https://github.com/CarmJos/MineSQL.git synced 2026-06-04 16:43:03 +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 @Override
public void unregisterSQLManager(@NotNull String name) { public void unregisterSQLManager(@NotNull String name) {
LOCK.lock(); LOCK.lock();
// 先清除命名空间
this.sqlManagerRegistry.remove(name);
// 再清除名称
for (Map.Entry<String, Set<String>> stringSetEntry : this.nameSpaceRegistry.entrySet()) { for (Map.Entry<String, Set<String>> stringSetEntry : this.nameSpaceRegistry.entrySet()) {
stringSetEntry.getValue().remove(name); stringSetEntry.getValue().remove(name);
} }
this.nameSpaceRegistry.entrySet().removeIf(stringSetEntry -> stringSetEntry.getValue().isEmpty());
LOCK.unlock(); LOCK.unlock();
} }
@@ -38,6 +38,7 @@ public class EasySQLBukkit extends JavaPlugin implements EasySQLPluginPlatform,
this.register(this, instanceName, sqlManager); this.register(this, instanceName, sqlManager);
} }
} }
// 获取指定UUID的玩家的盔甲
setup = true; setup = true;
} }