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(); } }