From 27d8493177fa7d1b9561ecc863c3f26dbd78d206 Mon Sep 17 00:00:00 2001 From: abhiram Date: Thu, 3 Dec 2020 16:06:10 +0530 Subject: [PATCH] Fixed Memory Leak --- src/main/java/net/limework/rediskript/RediSkript.java | 4 ++++ .../java/net/limework/rediskript/managers/RedisManager.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/limework/rediskript/RediSkript.java b/src/main/java/net/limework/rediskript/RediSkript.java index 7c2e8b9..80edf4b 100644 --- a/src/main/java/net/limework/rediskript/RediSkript.java +++ b/src/main/java/net/limework/rediskript/RediSkript.java @@ -58,6 +58,10 @@ public class RediSkript extends JavaPlugin { } } + public void SetRedisManager(RedisManager rm) + { + this.rm = rm; + } @Override public void onEnable() { saveDefaultConfig(); diff --git a/src/main/java/net/limework/rediskript/managers/RedisManager.java b/src/main/java/net/limework/rediskript/managers/RedisManager.java index 029b49d..4fb6de3 100644 --- a/src/main/java/net/limework/rediskript/managers/RedisManager.java +++ b/src/main/java/net/limework/rediskript/managers/RedisManager.java @@ -249,7 +249,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable { this.RedisService.shutdown(); this.RedisService = null; this.RedisReconnector = null; - + plugin.SetRedisManager(new RedisManager(plugin)); } public void reload() { this.shutdown();