mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-29 11:31:41 +01:00
Fixed ShutdownHook
This commit is contained in:
parent
e79c314267
commit
aca1affe9d
@ -24,7 +24,9 @@ import com.djrapitops.plugin.StaticHolder;
|
|||||||
import com.djrapitops.plugin.api.Benchmark;
|
import com.djrapitops.plugin.api.Benchmark;
|
||||||
import com.djrapitops.plugin.api.TimeAmount;
|
import com.djrapitops.plugin.api.TimeAmount;
|
||||||
import com.djrapitops.plugin.api.config.Config;
|
import com.djrapitops.plugin.api.config.Config;
|
||||||
|
import com.djrapitops.plugin.api.systems.TaskCenter;
|
||||||
import com.djrapitops.plugin.api.utility.Version;
|
import com.djrapitops.plugin.api.utility.Version;
|
||||||
|
import com.djrapitops.plugin.api.utility.log.DebugLog;
|
||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import com.djrapitops.plugin.settings.ColorScheme;
|
import com.djrapitops.plugin.settings.ColorScheme;
|
||||||
import com.djrapitops.plugin.task.AbsRunnable;
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
@ -223,6 +225,7 @@ public class Plan extends BukkitPlugin implements IPlan {
|
|||||||
Benchmark.stop("Enable", "Enable");
|
Benchmark.stop("Enable", "Enable");
|
||||||
Log.logDebug("Enable");
|
Log.logDebug("Enable");
|
||||||
Log.info(Locale.get(Msg.ENABLED).toString());
|
Log.info(Locale.get(Msg.ENABLED).toString());
|
||||||
|
StaticHolder.saveInstance(ShutdownHook.class, this.getClass());
|
||||||
new ShutdownHook(this);
|
new ShutdownHook(this);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.error("Plugin Failed to Initialize Correctly.");
|
Log.error("Plugin Failed to Initialize Correctly.");
|
||||||
@ -321,7 +324,9 @@ public class Plan extends BukkitPlugin implements IPlan {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.info(Locale.get(Msg.DISABLED).toString());
|
Log.info(Locale.get(Msg.DISABLED).toString());
|
||||||
super.onDisable();
|
Benchmark.pluginDisabled(Plan.class);
|
||||||
|
DebugLog.pluginDisabled(Plan.class);
|
||||||
|
TaskCenter.cancelAllKnownTasks(Plan.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
package main.java.com.djrapitops.plan;
|
package main.java.com.djrapitops.plan;
|
||||||
|
|
||||||
|
import com.djrapitops.plugin.StaticHolder;
|
||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
||||||
import main.java.com.djrapitops.plan.data.Action;
|
import main.java.com.djrapitops.plan.data.Action;
|
||||||
@ -69,6 +70,7 @@ public class ShutdownHook extends Thread {
|
|||||||
}
|
}
|
||||||
db = null;
|
db = null;
|
||||||
dataCache = null;
|
dataCache = null;
|
||||||
|
StaticHolder.unRegister(Plan.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user