mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 20:16:00 +01:00
Fix NPE trying to unload the plugin
This commit is contained in:
parent
199fb77a18
commit
de9953637f
@ -340,15 +340,19 @@ public synchronized void unload() {
|
|||||||
serverInterface.unregisterAllListeners();
|
serverInterface.unregisterAllListeners();
|
||||||
|
|
||||||
//stop scheduled threads
|
//stop scheduled threads
|
||||||
if (metricsThread != null) metricsThread.interrupt();
|
if (metricsThread != null) {
|
||||||
try {metricsThread.join(1000);} catch (InterruptedException ignore) { Thread.currentThread().interrupt(); }
|
metricsThread.interrupt();
|
||||||
if (metricsThread.isAlive()) Logger.global.logWarning("The metricsThread did not terminate correctly in time!");
|
try {metricsThread.join(1000);} catch (InterruptedException ignore) { Thread.currentThread().interrupt(); }
|
||||||
metricsThread = null;
|
if (metricsThread.isAlive()) Logger.global.logWarning("The metricsThread did not terminate correctly in time!");
|
||||||
|
metricsThread = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (periodicalSaveThread != null) periodicalSaveThread.interrupt();
|
if (periodicalSaveThread != null) {
|
||||||
try {periodicalSaveThread.join(1000);} catch (InterruptedException ignore) { Thread.currentThread().interrupt(); }
|
periodicalSaveThread.interrupt();
|
||||||
if (periodicalSaveThread.isAlive()) Logger.global.logWarning("The periodicalSaveThread did not terminate correctly in time!");
|
try {periodicalSaveThread.join(1000);} catch (InterruptedException ignore) { Thread.currentThread().interrupt(); }
|
||||||
periodicalSaveThread = null;
|
if (periodicalSaveThread.isAlive()) Logger.global.logWarning("The periodicalSaveThread did not terminate correctly in time!");
|
||||||
|
periodicalSaveThread = null;
|
||||||
|
}
|
||||||
|
|
||||||
//stop services
|
//stop services
|
||||||
if (renderManager != null) renderManager.stop();
|
if (renderManager != null) renderManager.stop();
|
||||||
|
Loading…
Reference in New Issue
Block a user