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; + } }