From 6944cf25791d0daf9011b6a0d6f392e50428ac2c Mon Sep 17 00:00:00 2001 From: Vankka Date: Wed, 13 Apr 2022 14:07:57 +0300 Subject: [PATCH] Unregister modules from the event bus on disable --- .../main/java/com/discordsrv/common/module/ModuleManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/main/java/com/discordsrv/common/module/ModuleManager.java b/common/src/main/java/com/discordsrv/common/module/ModuleManager.java index 25b870e9..486580a6 100644 --- a/common/src/main/java/com/discordsrv/common/module/ModuleManager.java +++ b/common/src/main/java/com/discordsrv/common/module/ModuleManager.java @@ -134,6 +134,7 @@ public class ModuleManager { AbstractModule abstractModule = getAbstract(module); try { logger.debug(module + " disabling"); + discordSRV.eventBus().unsubscribe(abstractModule); abstractModule.disable(); } catch (Throwable t) { discordSRV.logger().error("Failed to disable " + abstractModule.toString(), t);