From 5d032c761499a26df201b76b1c2c0bd2990c3357 Mon Sep 17 00:00:00 2001 From: Brianna Date: Wed, 15 Apr 2020 12:40:45 -0400 Subject: [PATCH] Terminate all threads on disable. --- Core/src/main/java/com/songoda/core/SongodaCore.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/src/main/java/com/songoda/core/SongodaCore.java b/Core/src/main/java/com/songoda/core/SongodaCore.java index a8fbcee2..93df6f44 100644 --- a/Core/src/main/java/com/songoda/core/SongodaCore.java +++ b/Core/src/main/java/com/songoda/core/SongodaCore.java @@ -17,6 +17,8 @@ import java.net.HttpURLConnection; import java.net.URL; import java.util.*; import java.util.logging.Level; + +import com.songoda.core.database.DataManagerAbstract; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -402,6 +404,8 @@ public class SongodaCore { if (pi != null) { registeredPlugins.remove(pi); } + // Terminate all active threads + DataManagerAbstract.terminateAllThreads(); if (event.getPlugin() == piggybackedPlugin) { // uh-oh! Abandon ship!! Bukkit.getServicesManager().unregisterAll(piggybackedPlugin);