From 288287c96d0b824dde49457bfd0d7bc15297c98c Mon Sep 17 00:00:00 2001 From: Roman Zhuravlev Date: Thu, 23 Oct 2025 22:32:06 +0500 Subject: [PATCH] Add close sqlAdapter on plugin disable --- velocity/src/main/java/org/zhdev/VelocityPreparedPlugin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/velocity/src/main/java/org/zhdev/VelocityPreparedPlugin.java b/velocity/src/main/java/org/zhdev/VelocityPreparedPlugin.java index 2cbeb39..f91f7f6 100644 --- a/velocity/src/main/java/org/zhdev/VelocityPreparedPlugin.java +++ b/velocity/src/main/java/org/zhdev/VelocityPreparedPlugin.java @@ -28,6 +28,10 @@ public abstract class VelocityPreparedPlugin extends VelocityPlugin implements P return new SqlAdapter(); } + protected void closeSqlAdapter() { + sqlAdapter.close(); + } + protected void loadPhrases() { ConfigSection languageSection = defaultConfig.getOrCreateSection("language"); String locale = languageSection.getString("locale", "default"); @@ -80,5 +84,6 @@ public abstract class VelocityPreparedPlugin extends VelocityPlugin implements P private void onProxyInitialization(ProxyShutdownEvent event) { onPreDisable(); onPostDisable(); + closeSqlAdapter(); } }