You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 18, 2020. It is now read-only.
All event handlers that are registered by plugins using some inputs aren't unregistered at all.
Even after a plugin has stopped the event handler is still called for all received events.
The event handlers by all event inputs that they register in their connectors also have to be unregistered at some point, probably in their shutdown method.
How to reproduce
Have a simple plugin like this:
importorg.codeoverflow.chatoverflow.api.plugin.{PluginImpl, PluginManager}
classSimpleTwitchChatPlugin(manager: PluginManager) extendsPluginImpl(manager) {
privatevalin= require.input.twitchChat("twitchIn", "The twitch input, of which all messages will be displayed", false)
privatevalchannel="skate702"overridedefsetup():Unit= {
in.get().setChannel(channel)
in.get().registerChatMessageReceiveEventHandler(ev => println(ev.getMessage))
}
overridedefloop():Unit= ()
overridedefshutdown():Unit= ()
}
Start the plugin. Notice that every chat message is printed once, as it should.
Restart the plugin, but not the framework. Notice that every chat message is printed four times.
It's printed four times, because the input has registered its internal handler twice and the plugin has the handler registered in the input twice. Each internal handler is calling all handlers by the plugin, which results in four calls.