From c4a51a0611ab6b5773ad46bd484969f35b6db726 Mon Sep 17 00:00:00 2001 From: xGinko Date: Fri, 2 Aug 2024 04:44:07 +0200 Subject: [PATCH] clear map on disable --- .../java/me/xginko/aef/AnarchyExploitFixes.java | 15 +++++++++------ .../java/me/xginko/aef/AnarchyExploitFixes.java | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java index 6fa28d8c..813e8db6 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java @@ -158,9 +158,9 @@ public void onDisable() { AEFListener.LISTENERS.clear(); PacketEvents.getAPI().terminate(); } - if (metrics != null) { - metrics.shutdown(); - metrics = null; + if (languageCacheMap != null) { + languageCacheMap.clear(); + languageCacheMap = null; } if (cachingPermTool != null) { cachingPermTool.disable(); @@ -170,11 +170,14 @@ public void onDisable() { tickReporter.disable(); tickReporter = null; } + if (metrics != null) { + metrics.shutdown(); + metrics = null; + } + unPrefixedLogger = null; + prefixedLogger = null; instance = null; config = null; - languageCacheMap = null; - prefixedLogger = null; - unPrefixedLogger = null; } public static AnarchyExploitFixes getInstance() { diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/AnarchyExploitFixes.java b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/AnarchyExploitFixes.java index 13857463..d47ce809 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/AnarchyExploitFixes.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/AnarchyExploitFixes.java @@ -159,9 +159,9 @@ public void onDisable() { AEFModule.ENABLED_MODULES.clear(); PacketEvents.getAPI().terminate(); } - if (metrics != null) { - metrics.shutdown(); - metrics = null; + if (languageCacheMap != null) { + languageCacheMap.clear(); + languageCacheMap = null; } if (cachingPermTool != null) { cachingPermTool.disable(); @@ -175,11 +175,14 @@ public void onDisable() { datastore.disable(); datastore = null; } + if (metrics != null) { + metrics.shutdown(); + metrics = null; + } + unPrefixedLogger = null; + prefixedLogger = null; instance = null; config = null; - languageCacheMap = null; - prefixedLogger = null; - unPrefixedLogger = null; } public static AnarchyExploitFixes getInstance() {