diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/UpdateCountTask.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/UpdateCountTask.java index aaa0c47..1d22bc2 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/UpdateCountTask.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/UpdateCountTask.java @@ -21,7 +21,13 @@ public class UpdateCountTask implements Runnable { @Override public void run() { - if (kill) return; + if (kill) { + if (rsc != null) { + plugin.getPool().returnResource(rsc); + rsc = null; + } + return; + } int c = plugin.getProxy().getOnlineCount(); rsc.set("server:" + plugin.getServerId() + ":playerCount", String.valueOf(c)); for (String i : plugin.getServers()) {