From 87fe5206e90811085f1a96cfe8d702ffd427909c Mon Sep 17 00:00:00 2001 From: liujiahua123123 Date: Sat, 17 Aug 2019 15:58:40 +0800 Subject: [PATCH] GC --- .../java/net/mamoe/mirai/event/MiraiEventHook.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/main/java/net/mamoe/mirai/event/MiraiEventHook.java b/mirai-core/src/main/java/net/mamoe/mirai/event/MiraiEventHook.java index a8e6e1936..9335283cb 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/event/MiraiEventHook.java +++ b/mirai-core/src/main/java/net/mamoe/mirai/event/MiraiEventHook.java @@ -6,10 +6,12 @@ import net.mamoe.mirai.event.events.Cancellable; import net.mamoe.mirai.event.events.MiraiEvent; import net.mamoe.mirai.event.events.server.ServerDisableEvent; +import java.io.Closeable; +import java.io.IOException; import java.util.function.Consumer; import java.util.function.Predicate; -public class MiraiEventHook { +public class MiraiEventHook implements Closeable { @Getter Class eventClass; @@ -98,5 +100,9 @@ public class MiraiEventHook { } - + @Override + public void close(){ + this.handler = null; + this.valid = null; + } }