summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-19 10:34:02 +0200
committersnowleo <schneeleo@gmail.com>2011-07-19 10:34:02 +0200
commit4a963b22f128756340d59ca601b1625637ca9aa5 (patch)
tree20a21ce726cab2b7820d7fd538fdb59f85ea2e6a /EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
parent150a0e0ddddc421e2a68dc7fa9d39b565beca439 (diff)
downloadEssentials-4a963b22f128756340d59ca601b1625637ca9aa5.tar
Essentials-4a963b22f128756340d59ca601b1625637ca9aa5.tar.gz
Essentials-4a963b22f128756340d59ca601b1625637ca9aa5.tar.lz
Essentials-4a963b22f128756340d59ca601b1625637ca9aa5.tar.xz
Essentials-4a963b22f128756340d59ca601b1625637ca9aa5.zip
Close database connections on plugin deactivation
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
index 216a37564..ed02291cf 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
@@ -12,7 +12,9 @@ import java.beans.PropertyVetoException;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Filter;
import java.util.logging.Level;
+import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -59,7 +61,7 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
pm.registerEvent(Type.LIGHTNING_STRIKE, weatherListener, Priority.Highest, this);
pm.registerEvent(Type.THUNDER_CHANGE, weatherListener, Priority.Highest, this);
pm.registerEvent(Type.WEATHER_CHANGE, weatherListener, Priority.Highest, this);
-
+
reloadConfig();
ess.addReloadListener(this);
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
@@ -96,6 +98,10 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
public void reloadConfig()
{
+ if (storage != null)
+ {
+ storage.onPluginDeactivation();
+ }
for (ProtectConfig protectConfig : ProtectConfig.values())
{
if (protectConfig.isList())
@@ -166,6 +172,10 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
public void onDisable()
{
+ if (storage != null)
+ {
+ storage.onPluginDeactivation();
+ }
}
public IEssentials getEssentials()