feat: clean engine after disable

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-04-03 15:07:05 +08:00
parent ac83acd4c8
commit 28db77333e
4 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId>
<artifactId>MiaoScript</artifactId>
<version>0.4.0</version>
<version>0.4.1</version>
<developers>
<developer>
<id>502647092</id>
@ -54,6 +54,7 @@
<properties>
<env.GIT_COMMIT>DEV</env.GIT_COMMIT>
<update.changes>
§620-04-03 §afeat: 优化 框架卸载逻辑;
§620-03-31 §afeat: require 新增 内建 nodejs 模块;
§620-03-03 §afeat: require 新增 淘宝镜像源拉取;
§620-02-27 §afeat: 异步加载脚本引擎;

View File

@ -23,5 +23,6 @@ public class MiaoScriptBungee extends Plugin {
@Override
public void onDisable() {
engine.disableEngine();
engine = null;
}
}

View File

@ -20,5 +20,6 @@ public class MiaoScriptNukkit extends PluginBase {
@Override
public void onDisable() {
engine.disableEngine();
engine = null;
}
}

View File

@ -19,7 +19,7 @@ import lombok.SneakyThrows;
* @author
* Created on 2017/10/25 20:35.
*/
@Plugin(id = "miaoscript", name = "MiaoScript", version = "1.0", authors = "喵♂呜")
@Plugin(id = "miaoscript", name = "MiaoScript", version = "1.0", authors = "MiaoWoo")
public class MiaoScriptSponge {
private ScriptEngine engine;
@Inject
@ -40,6 +40,7 @@ public class MiaoScriptSponge {
@SneakyThrows
public void onStop(GameStoppingServerEvent event) {
engine.disableEngine();
engine = null;
}
@Listener