Unregister modules from the event bus on disable

This commit is contained in:
Vankka 2022-04-13 14:07:57 +03:00
parent 8a673875a6
commit 6944cf2579
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -134,6 +134,7 @@ public class ModuleManager {
AbstractModule<?> abstractModule = getAbstract(module); AbstractModule<?> abstractModule = getAbstract(module);
try { try {
logger.debug(module + " disabling"); logger.debug(module + " disabling");
discordSRV.eventBus().unsubscribe(abstractModule);
abstractModule.disable(); abstractModule.disable();
} catch (Throwable t) { } catch (Throwable t) {
discordSRV.logger().error("Failed to disable " + abstractModule.toString(), t); discordSRV.logger().error("Failed to disable " + abstractModule.toString(), t);