Dieser Commit ist enthalten in:
Ursprung
368195bed2
Commit
297791ec60
@ -143,7 +143,7 @@ public class Core extends JavaPlugin{
|
||||
public void onDisable() {
|
||||
TinyProtocol.instance.close();
|
||||
errorHandler.unregister();
|
||||
if(!standalone) {
|
||||
if(!standalone && crashDetector.onMainThread()) {
|
||||
Statement.close();
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
package de.steamwar.core;
|
||||
|
||||
import de.steamwar.sql.SWException;
|
||||
import de.steamwar.sql.Statement;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -47,6 +48,10 @@ public class CrashDetector {
|
||||
watchdog.interrupt();
|
||||
}
|
||||
|
||||
public boolean onMainThread() {
|
||||
return Thread.currentThread() == mainThread;
|
||||
}
|
||||
|
||||
private void run() {
|
||||
while (run) {
|
||||
long curTime = System.currentTimeMillis();
|
||||
@ -58,6 +63,7 @@ public class CrashDetector {
|
||||
if(Core.getInstance().isEnabled()) {
|
||||
Core.getInstance().onDisable();
|
||||
}
|
||||
Statement.close();
|
||||
//System.exit(0); Does freeze, potential freezing issues: ConsoleRestoreHook, ApplicationShutdownHooks or DeleteOnExitHook
|
||||
Runtime.getRuntime().halt(0);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren