Terminate all threads on disable.

This commit is contained in:
Brianna 2020-04-15 12:40:45 -04:00
parent 915bb5e9c6
commit 5d032c7614

View File

@ -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);